diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-17 00:42:38 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-03-17 00:57:16 +0100 |
commit | 9344a79233882ac278b3812b91b6edf874ef5d16 (patch) | |
tree | e5bd324104a9d8dcf1839de8a880845f8739a37a /src/utils/sha256.cpp | |
parent | 0e24b15a386d45f43cea76c1b8ad744728a3190e (diff) | |
download | manaserv-9344a79233882ac278b3812b91b6edf874ef5d16.tar.gz manaserv-9344a79233882ac278b3812b91b6edf874ef5d16.tar.bz2 manaserv-9344a79233882ac278b3812b91b6edf874ef5d16.tar.xz manaserv-9344a79233882ac278b3812b91b6edf874ef5d16.zip |
Micro-optimizations related to std::string
* Rely on the fact that a std::string is empty by default
* Use std::string::empty() rather than comparing to ""
* Construct with std::string() rather than from ""
Reviewed-by: Bertram
Diffstat (limited to 'src/utils/sha256.cpp')
-rw-r--r-- | src/utils/sha256.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/sha256.cpp b/src/utils/sha256.cpp index ba6a5078..102171e9 100644 --- a/src/utils/sha256.cpp +++ b/src/utils/sha256.cpp @@ -263,7 +263,7 @@ std::string SHA256Hash(const char *src, int len) SHA256Final(&ctx, bytehash); // Convert it to hex const char* hxc = "0123456789abcdef"; - std::string hash = ""; + std::string hash; for (int i = 0; i < SHA256_DIGEST_SIZE; i++) { hash += hxc[bytehash[i] / 16]; |