Decompile fn_02766 (TrimRight)

Batch #11748 by Yommy: 1 byte-identical, 0 confirmed by peer review.

- fn_02766 TrimRight: byte-identical

Merged automatically: every function is byte-identical to the original.
This commit is contained in:
ragnarok-clanker 2026-11-05 04:36:47 +00:00
commit dcfabe50eb

View file

@ -180,8 +180,7 @@ std::vector<std::string> Split(std::string_view text, std::string_view delimiter
// FUNCTION: fn_02766
void TrimRight(std::string& text, std::string_view characters) {
if (characters.empty()) {
auto last = std::find_if(text.rbegin(), text.rend(), [](unsigned char c) { return !std::isspace(c); });
text.erase(last.base(), text.end());
text.erase(std::find_if(text.rbegin(), text.rend(), [](char c) { return !std::isspace(static_cast<unsigned char>(c)); }).base(), text.end());
return;
}
text.erase(text.find_last_not_of(characters) + 1);