X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhashcomp.cpp;h=4eb416406426331923693a5fff99072b73b40fb6;hb=03a623a284b6c9f2f11f549c55333c45c4d91eab;hp=29b67aea46e75c9ea007137d64ec7dbf4fb2cd79;hpb=01ac5148e948de53cd708bb28d0fd237263a0fbf;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index 29b67aea4..4eb416406 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -20,8 +20,6 @@ */ -/* $Core */ - #include "inspircd.h" #include "hashcomp.h" @@ -288,7 +286,7 @@ bool irc::tokenstream::GetToken(long &token) return returnval; } -irc::sepstream::sepstream(const std::string& source, char seperator, bool allowempty) +irc::sepstream::sepstream(const std::string& source, char separator, bool allowempty) : tokens(source), sep(separator), pos(0), allow_empty(allowempty) { } @@ -397,14 +395,14 @@ int irc::modestacker::GetStackedLine(std::vector &result, int max_l return n; } -irc::stringjoiner::stringjoiner(const std::string& seperator, const std::vector& sequence, unsigned int begin, unsigned int end) +irc::stringjoiner::stringjoiner(const std::vector& sequence) { - if (end < begin) + if (sequence.empty()) return; // nothing to do here - for (unsigned int v = begin; v < end; v++) - joined.append(sequence[v]).append(seperator); - joined.append(sequence[end]); + for (std::vector::const_iterator i = sequence.begin(); i != sequence.end(); ++i) + joined.append(*i).push_back(' '); + joined.erase(joined.end()-1); } irc::portparser::portparser(const std::string &source, bool allow_overlapped)