mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-02-02 17:11:20 +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
@@ -591,8 +591,7 @@ typedef std::map<uint32_t, const GRFConfig *> GrfIdMap; ///< Map of grfid to the
|
||||
static void FillGrfidMap(const GRFConfig *c, GrfIdMap *grfid_map)
|
||||
{
|
||||
while (c != nullptr) {
|
||||
std::pair<uint32_t, const GRFConfig *> p(c->ident.grfid, c);
|
||||
grfid_map->insert(p);
|
||||
grfid_map->emplace(c->ident.grfid, c);
|
||||
c = c->next;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user