Common/IniFile: Fix case sensitivity mismatch in IniFile::Section::Delete()

values uses a case insensitive comparison, so erasing the equivalent key in keys_order also must do so.
This commit is contained in:
Admiral H. Curtiss 2025-01-08 05:28:53 +01:00
parent 7133bfbb0e
commit c567248b73
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 2 additions and 1 deletions

View File

@ -85,7 +85,8 @@ bool IniFile::Section::Delete(std::string_view key)
return false;
values.erase(it);
keys_order.erase(std::ranges::find(keys_order, key));
keys_order.erase(std::ranges::find_if(
keys_order, [&](std::string_view v) { return CaseInsensitiveEquals(key, v); }));
return true;
}