You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The string::RFind method does not work properly when using String::INVALID_INDEX as the start index. This is the default value for RFind and is intended to start looking at the end of the string.
The
string::RFind
method does not work properly when usingString::INVALID_INDEX
as the start index. This is the default value for RFind and is intended to start looking at the end of the string.Instead it just returns
String::INVALID_INDEX
. This is because the method does not actually handle theString::INVALID_INDEX
value correctly likestd::string::rfind
does:https://github.com/Solokiller/HL_Tools/blob/a028f420f535c086eb22a9c0ee5d026f57dd4b8f/src/stdlib/utility/CString.cpp#L796-L825
string::FindLastOf
does work correctly, but is not a replacement forRFind
.Here's an example where it returns the wrong value:
index
should be25
but is actuallyString::INVALID_INDEX
.The text was updated successfully, but these errors were encountered: