From 878c46a2cadca44476d9fa6960cfc8d061f43667 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 7 Nov 2026 02:52:14 +0000 Subject: [PATCH] Decompile fn_13883 (StripColorTokens) Batch #13855 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_13883 StripColorTokens: logic confirmed by peer review Peer-reviewed-by: Yommy, KWDev, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Utility/Text/TextTokens.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Source/Utility/Text/TextTokens.cpp b/Source/Utility/Text/TextTokens.cpp index f34e73222..ffe76c35e 100644 --- a/Source/Utility/Text/TextTokens.cpp +++ b/Source/Utility/Text/TextTokens.cpp @@ -45,17 +45,19 @@ bool IsHexColorToken(const char* text, const char* end) { std::string __stdcall StripColorTokens(const char* text, std::uint32_t length) { std::string result; result.reserve(length); - if (text != nullptr) { - const char* current = text; - const char* end = text + length; - while (current < end) { - if (IsHexColorToken(current, end)) { - current += 7; - } else if (IsPipeColorToken(current)) { - current += 3; - } else { - result.push_back(*current++); - } + if (text == nullptr) { + return result; + } + + const char* current = text; + const char* end = text + length; + while (current < end) { + if (IsHexColorToken(current, end)) { + current += 7; + } else if (IsPipeColorToken(current)) { + current += 3; + } else { + result.push_back(*current++); } }