X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhashcomp.cpp;h=b320f3546fa6b5a7dd507774d2a52c4719ec0d5f;hb=ee641f3f229143940fbe359ac98863edfdf249ce;hp=25abd471f96eaf8b013fd5bc253f8f4d6e5d3305;hpb=0d3a6719b8d924ea663f95e3e2fb834cbd80c6a5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 25abd471f..b320f3546 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -245,10 +245,6 @@ irc::tokenstream::tokenstream(const std::string &source) : tokens(source), last_ n = tokens.begin(); } -irc::tokenstream::~tokenstream() -{ -} - bool irc::tokenstream::GetToken(std::string &token) { std::string::iterator lsp = last_starting_position; @@ -361,42 +357,6 @@ bool irc::sepstream::StreamEnd() return ((n + 1) == tokens.end()); } -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; -} - -CoreExport const char* irc::Spacify(const char* n) -{ - static char x[MAXBUF]; - strlcpy(x,n,MAXBUF); - for (char* y = x; *y; y++) - if (*y == '_') - *y = ' '; - return x; -} - - irc::modestacker::modestacker(bool add) : adding(add) { sequence.clear(); @@ -462,37 +422,17 @@ int irc::modestacker::GetStackedLine(std::vector &result, int max_l return n; } -irc::stringjoiner::stringjoiner(const std::string &seperator, const std::vector &sequence, int begin, int end) -{ - if (end < begin) - return; // nothing to do here - - for (int v = begin; v < end; v++) - joined.append(sequence[v]).append(seperator); - joined.append(sequence[end]); -} - -irc::stringjoiner::stringjoiner(const std::string &seperator, const std::deque &sequence, int begin, int end) -{ - if (end < begin) - return; // nothing to do here - - for (int v = begin; v < end; v++) - joined.append(sequence[v]).append(seperator); - joined.append(sequence[end]); -} - -irc::stringjoiner::stringjoiner(const std::string &seperator, const char* const* sequence, int begin, int end) +irc::stringjoiner::stringjoiner(const std::string& seperator, const std::vector& sequence, unsigned int begin, unsigned int end) { if (end < begin) return; // nothing to do here - for (int v = begin; v < end; v++) + for (unsigned int v = begin; v < end; v++) joined.append(sequence[v]).append(seperator); joined.append(sequence[end]); } -std::string& irc::stringjoiner::GetJoined() +const std::string& irc::stringjoiner::GetJoined() const { return joined; }