diff options
| author | 2014-02-05 16:44:22 +0000 | |
|---|---|---|
| committer | 2014-02-06 23:11:51 +0100 | |
| commit | 9dd4108273d95204edbc366618da6500571267df (patch) | |
| tree | 2e78f10477d88e2fdb288d17cfded87b10fa2313 /src/hashcomp.cpp | |
| parent | Fix various cases of UUID exposure. (diff) | |
Convert irc::stringjoiner to be a method instead of a class.
Add separator parameter
Diffstat (limited to 'src/hashcomp.cpp')
| -rw-r--r-- | src/hashcomp.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index f1d0f0678..32f74475f 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -414,14 +414,16 @@ int irc::modestacker::GetStackedLine(std::vector<std::string> &result, int max_l return n; } -irc::stringjoiner::stringjoiner(const std::vector<std::string>& sequence) +std::string irc::stringjoiner(const std::vector<std::string>& sequence, char separator) { + std::string joined; if (sequence.empty()) - return; // nothing to do here + return joined; // nothing to do here for (std::vector<std::string>::const_iterator i = sequence.begin(); i != sequence.end(); ++i) - joined.append(*i).push_back(' '); + joined.append(*i).push_back(separator); joined.erase(joined.end()-1); + return joined; } irc::portparser::portparser(const std::string &source, bool allow_overlapped) |
