From 780757cbc172daa4d9973e8e3b87fd42cfac5541 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Thu, 16 May 2013 15:34:45 +0200 Subject: Deduplicate hex string creation code --- src/hashcomp.cpp | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/hashcomp.cpp') 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(); -- cgit v1.3.1-10-gc9f91