slightly optimized 'TruncSpace' helper function .

This commit is contained in:
Zero Fanker 2024-06-23 12:00:50 -04:00
parent 82bc843940
commit e64655d878

View file

@ -508,8 +508,9 @@ void TruncSpace(CString& str)
{
str.TrimLeft();
str.TrimRight();
if (str.Find(" ") >= 0) {
str.Delete(str.Find(" "), str.GetLength() - str.Find(" "));
auto const spacePos = str.Find(" ");
if (spacePos >= 0) {
str.Delete(spacePos, str.GetLength() - spacePos);
}
}