diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2012-02-09T17·27+0100 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2012-02-09T17·27+0100 |
commit | d5a5a83ad4fb8aba3b334039f567267a0463ee5a (patch) | |
tree | a6ce83d3c595fa987afed1c4dbbe18e82cc18322 /src/libutil/hash.cc | |
parent | ec2827f5fc4fc8081daacb197d40d22a5e429df4 (diff) |
Use data() instead of c_str() where appropriate
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r-- | src/libutil/hash.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index bbfe7847fd8a..697a6b475b13 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -136,7 +136,7 @@ string printHash32(const Hash & hash) Hash hash2(hash); unsigned int len = hashLength32(hash); - const char * chars = base32Chars.c_str(); + const char * chars = base32Chars.data(); string s(len, '0'); @@ -186,7 +186,7 @@ Hash parseHash32(HashType ht, const string & s) { Hash hash(ht); - const char * chars = base32Chars.c_str(); + const char * chars = base32Chars.data(); for (unsigned int i = 0; i < s.length(); ++i) { char c = s[i]; @@ -271,7 +271,7 @@ Hash hashString(HashType ht, const string & s) Ctx ctx; Hash hash(ht); start(ht, ctx); - update(ht, ctx, (const unsigned char *) s.c_str(), s.length()); + update(ht, ctx, (const unsigned char *) s.data(), s.length()); finish(ht, ctx, hash.hash); return hash; } |