From e6ea9f7d4a4bf015524749da6ffeecf1d15c9268 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 27 Aug 2024 14:29:56 +0100 Subject: Change InspIRCd::ProcessColors to take a string instead of a vector. This is more useful for how MOTDs are processed now as we iterate through them anyway and this allows us to avoid a needless second iteration. --- src/helperfuncs.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index bd8f4a231..5ebb6e44d 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -120,6 +120,12 @@ void InspIRCd::StripColor(std::string& sentence) } void InspIRCd::ProcessColors(std::vector& input) +{ + for (auto& line : input) + ProcessColors(line); +} + +void InspIRCd::ProcessColors(std::string& ret) { /* * Replace all color codes from the special[] array to actual @@ -148,7 +154,6 @@ void InspIRCd::ProcessColors(std::vector& input) special_chars("", "") }; - for (auto& ret : input) { for(int i = 0; !special[i].character.empty(); ++i) { -- cgit v1.3.1-10-gc9f91