From d216fd0af570782b8c82a51f92f2d02067132efc Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 18 Jan 2022 16:49:09 +0000 Subject: Use vector instead of file_cache in ProcessColors. --- src/helperfuncs.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 5ca4d4b87..910f0fe32 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -99,7 +99,7 @@ void InspIRCd::StripColor(std::string &sentence) } } -void InspIRCd::ProcessColors(file_cache& input) +void InspIRCd::ProcessColors(std::vector& input) { /* * Replace all color codes from the special[] array to actual @@ -127,9 +127,8 @@ void InspIRCd::ProcessColors(file_cache& input) special_chars("", "") }; - for(file_cache::iterator it = input.begin(), it_end = input.end(); it != it_end; it++) + for (auto& ret : input) { - std::string ret = *it; for(int i = 0; special[i].character.empty() == false; ++i) { std::string::size_type pos = ret.find(special[i].character); @@ -154,7 +153,6 @@ void InspIRCd::ProcessColors(file_cache& input) ret = ret.substr(0, pos) + "\\" + ret.substr(pos + 2); pos = ret.find("\\\\", pos + 1); } - *it = ret; } } -- cgit v1.3.1-10-gc9f91