mirror of https://github.com/OpenTTD/OpenTTD
(svn r19970) -Fix (r14742): SmallMap::Insert() did not compile. Construct new items like operator[].
parent
55a684efc1
commit
67bec51f27
|
@ -86,7 +86,9 @@ struct SmallMap : SmallVector<SmallPair<T, U>, S> {
|
||||||
FORCEINLINE bool Insert(const T &key, const U &data)
|
FORCEINLINE bool Insert(const T &key, const U &data)
|
||||||
{
|
{
|
||||||
if (this->Find(key) != this->End()) return false;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue