aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-06-23 10:44:40 +0000
committerlloyd <[email protected]>2006-06-23 10:44:40 +0000
commit8b1c1c4885aa921d73048312ff31517b3ca18a8b (patch)
tree8df1461e5da3d112947417ecbe223e1b7112ef37
parent571fea5ac667b88a66604ecdba05d8324f5e9de7 (diff)
Use std::string::clear() rather than assign the empty string when
we want to remove the current contents of a string object.
-rw-r--r--src/asn1_tm.cpp6
-rw-r--r--src/parsing.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/asn1_tm.cpp b/src/asn1_tm.cpp
index 25b434609..e59b352c7 100644
--- a/src/asn1_tm.cpp
+++ b/src/asn1_tm.cpp
@@ -93,7 +93,7 @@ void X509_Time::set_to(const std::string& time_str)
{
if(current != "")
params.push_back(current);
- current = "";
+ current.clear();
}
}
if(current != "")
@@ -140,7 +140,7 @@ void X509_Time::set_to(const std::string& t_spec, ASN1_Tag tag)
for(u32bit j = 0; j != YEAR_SIZE; ++j)
current += t_spec[j];
params.push_back(current);
- current = "";
+ current.clear();
for(u32bit j = YEAR_SIZE; j != t_spec.size() - 1; ++j)
{
@@ -148,7 +148,7 @@ void X509_Time::set_to(const std::string& t_spec, ASN1_Tag tag)
if(current.size() == 2)
{
params.push_back(current);
- current = "";
+ current.clear();
}
}
diff --git a/src/parsing.cpp b/src/parsing.cpp
index 4939cd082..99d4205ea 100644
--- a/src/parsing.cpp
+++ b/src/parsing.cpp
@@ -98,7 +98,7 @@ std::vector<std::string> parse_algorithm_name(const std::string& namex)
elems.push_back(substring.substr(1));
else
elems.push_back(substring);
- substring = "";
+ substring.clear();
}
else
substring += c;
@@ -125,7 +125,7 @@ std::vector<std::string> split_on(const std::string& str, char delim)
{
if(substr != "")
elems.push_back(substr);
- substr = "";
+ substr.clear();
}
else
substr += *j;
@@ -155,7 +155,7 @@ std::vector<u32bit> parse_asn1_oid(const std::string& oid)
if(substring == "")
throw Invalid_OID(oid);
oid_elems.push_back(to_u32bit(substring));
- substring = "";
+ substring.clear();
}
else
substring += c;