mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-22 19:54:06 +01:00
Codechange: Use map.emplace() instead of map.insert(std::pair).
This avoids a copy of the pair into the map.
This commit is contained in:
committed by
Peter Nelson
parent
57d7359b1a
commit
ed2db80990
@@ -99,7 +99,7 @@ void BuildCargoLabelMap()
|
||||
/* Label already exists, don't addd again. */
|
||||
if (CargoSpec::label_map.count(cs.label) != 0) continue;
|
||||
|
||||
CargoSpec::label_map.insert(std::make_pair(cs.label, cs.Index()));
|
||||
CargoSpec::label_map.emplace(cs.label, cs.Index());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user