summaryrefslogtreecommitdiff
path: root/src/hashcomp.cpp
diff options
context:
space:
mode:
authorattilamolnar <attilamolnar@hush.com>2013-06-12 19:30:15 +0200
committerattilamolnar <attilamolnar@hush.com>2013-06-12 19:30:15 +0200
commitc23d09f65084e6088111dc974f0e290b042de89d (patch)
treeadf4e9b60d41019980f2e85bcaceeb843cad2af0 /src/hashcomp.cpp
parent79f46c80c2df066e88c18322a2168a144087b811 (diff)
Simplify stringjoiner: take 1 parameter, join from begin() to end() and use space as the sep char
Diffstat (limited to 'src/hashcomp.cpp')
-rw-r--r--src/hashcomp.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index 06b3ce669..3f3754884 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -397,14 +397,14 @@ int irc::modestacker::GetStackedLine(std::vector<std::string> &result, int max_l
return n;
}
-irc::stringjoiner::stringjoiner(const std::string& separator, const std::vector<std::string>& sequence, unsigned int begin, unsigned int end)
+irc::stringjoiner::stringjoiner(const std::vector<std::string>& 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(separator);
- joined.append(sequence[end]);
+ for (std::vector<std::string>::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)