diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-04-28 15:19:09 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-04-28 15:19:09 +0200 |
commit | 55477059cfd93e3924c7169f686f3eb0dcb6758a (patch) | |
tree | fba56ffc8e5e077b3688f21fde6bd2c15d8c8ab1 | |
parent | 8f34594cb7d600ccff100dff1817b69b03756ea2 (diff) |
core_whois Simplify CommandWhois::SplitChanList()
-rw-r--r-- | src/coremods/core_whois.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/coremods/core_whois.cpp b/src/coremods/core_whois.cpp index faf5863ba..d532dc9a1 100644 --- a/src/coremods/core_whois.cpp +++ b/src/coremods/core_whois.cpp @@ -112,12 +112,9 @@ std::string CommandWhois::ChannelList(User* source, User* dest, bool spy) void CommandWhois::SplitChanList(WhoisContextImpl& whois, const std::string& cl) { - std::string line; - std::ostringstream prefix; + std::string line(1, ':'); std::string::size_type start, pos; - prefix << ":"; - line = prefix.str(); const std::string::size_type namelen = ServerInstance->Config->ServerName.length() + 6 + whois.GetTarget()->nick.length() + 1; for (start = 0; (pos = cl.find(' ', start)) != std::string::npos; start = pos+1) @@ -125,13 +122,13 @@ void CommandWhois::SplitChanList(WhoisContextImpl& whois, const std::string& cl) if (line.length() + namelen + pos - start > 510) { whois.SendLine(319, line); - line = prefix.str(); + line.erase(1); } line.append(cl, start, pos - start + 1); } - if (line.length() != prefix.str().length()) + if (line.length() > 1) { whois.SendLine(319, line); } |