mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +03:00
C++11: Update StringHashMap
This commit is contained in:
parent
590e6b1258
commit
1199863e47
@ -149,9 +149,8 @@ public:
|
|||||||
if (!i.found())
|
if (!i.found())
|
||||||
{
|
{
|
||||||
memory_used_ += key.length() + 1;
|
memory_used_ += key.length() + 1;
|
||||||
if (!internal_.add(i))
|
if (!internal_.add(i, aKey))
|
||||||
return false;
|
return false;
|
||||||
i->key = aKey;
|
|
||||||
}
|
}
|
||||||
i->value = value;
|
i->value = value;
|
||||||
return true;
|
return true;
|
||||||
@ -163,11 +162,9 @@ public:
|
|||||||
Insert i = internal_.findForAdd(key);
|
Insert i = internal_.findForAdd(key);
|
||||||
if (i.found())
|
if (i.found())
|
||||||
return false;
|
return false;
|
||||||
if (!internal_.add(i))
|
if (!internal_.add(i, aKey, value))
|
||||||
return false;
|
return false;
|
||||||
memory_used_ += key.length() + 1;
|
memory_used_ += key.length() + 1;
|
||||||
i->key = aKey;
|
|
||||||
i->value = value;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,9 +222,8 @@ public:
|
|||||||
// Only value needs to be set after.
|
// Only value needs to be set after.
|
||||||
bool add(Insert &i, const char *aKey)
|
bool add(Insert &i, const char *aKey)
|
||||||
{
|
{
|
||||||
if (!internal_.add(i))
|
if (!internal_.add(i, aKey))
|
||||||
return false;
|
return false;
|
||||||
i->key = aKey;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user