diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-05-16 15:34:45 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-05-18 21:07:42 +0200 |
commit | 780757cbc172daa4d9973e8e3b87fd42cfac5541 (patch) | |
tree | 0a4d3a8ebfd8c3bd992537a7349ff02aa48389a0 /src/hashcomp.cpp | |
parent | 8f27fefa75e2952e7ab8757eb9fe4af4586817f0 (diff) |
Deduplicate hex string creation code
Diffstat (limited to 'src/hashcomp.cpp')
-rw-r--r-- | src/hashcomp.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 4ddf942ea..a2f99b70c 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -365,27 +365,6 @@ irc::sepstream::~sepstream() { } -std::string irc::hex(const unsigned char *raw, size_t rawsz) -{ - if (!rawsz) - return ""; - - /* EWW! This used to be using sprintf, which is WAY inefficient. -Special */ - - const char *hex = "0123456789abcdef"; - static char hexbuf[MAXBUF]; - - size_t i, j; - for (i = 0, j = 0; j < rawsz; ++j) - { - hexbuf[i++] = hex[raw[j] / 16]; - hexbuf[i++] = hex[raw[j] % 16]; - } - hexbuf[i] = 0; - - return hexbuf; -} - irc::modestacker::modestacker(bool add) : adding(add) { sequence.clear(); |