mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r19970) -Fix (r14742): SmallMap::Insert() did not compile. Construct new items like operator[].
This commit is contained in:
parent
55a684efc1
commit
67bec51f27
@ -86,7 +86,9 @@ struct SmallMap : SmallVector<SmallPair<T, U>, S> {
|
||||
FORCEINLINE bool Insert(const T &key, const U &data)
|
||||
{
|
||||
if (this->Find(key) != this->End()) return false;
|
||||
new (this->Append()) Pair(key, data);
|
||||
Pair *n = this->Append();
|
||||
n->first = key;
|
||||
n->second = data;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user