mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-23 04:04:09 +01:00
Codechange: Prefer string equality instead of comparison. (#14727)
This commit is contained in:
@@ -173,8 +173,7 @@ IniGroup &IniLoadFile::CreateGroup(std::string_view name)
|
||||
*/
|
||||
void IniLoadFile::RemoveGroup(std::string_view name)
|
||||
{
|
||||
size_t len = name.length();
|
||||
this->groups.remove_if([&name, &len](const IniGroup &group) { return group.name.compare(0, len, name) == 0; });
|
||||
this->groups.remove_if([&name](const IniGroup &group) { return group.name.starts_with(name); });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user