mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-22 15:51:16 +00:00
use reference to match available code
This commit is contained in:
parent
6d3df6f634
commit
6a0bb6ca1c
@ -56,8 +56,8 @@ class MxHashTable : public MxCore
|
|||||||
{
|
{
|
||||||
// Save a reference to the current table
|
// Save a reference to the current table
|
||||||
// so we can walk nodes and re-insert
|
// so we can walk nodes and re-insert
|
||||||
MxHashTableNode<T> **old_table = m_slots;
|
|
||||||
MxU32 old_size = m_numSlots;
|
MxU32 old_size = m_numSlots;
|
||||||
|
MxHashTableNode<T> **old_table = m_slots;
|
||||||
|
|
||||||
switch (m_resizeOption) {
|
switch (m_resizeOption) {
|
||||||
case HASH_TABLE_OPT_EXPAND_ADD:
|
case HASH_TABLE_OPT_EXPAND_ADD:
|
||||||
@ -156,10 +156,10 @@ class MxHashTableCursor : public MxCore
|
|||||||
return m_match != NULL;
|
return m_match != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetMatch(T **p_obj)
|
void GetMatch(T*& p_obj)
|
||||||
{
|
{
|
||||||
if (m_match) {
|
if (m_match) {
|
||||||
*p_obj = m_match->m_obj;
|
p_obj = m_match->m_obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ void MxVariableTable::SetVariable(const char *p_key, const char *p_value)
|
|||||||
|
|
||||||
if (cursor.Find(var)) {
|
if (cursor.Find(var)) {
|
||||||
delete var;
|
delete var;
|
||||||
cursor.GetMatch(&var);
|
cursor.GetMatch(var);
|
||||||
var->SetValue(p_value);
|
var->SetValue(p_value);
|
||||||
} else {
|
} else {
|
||||||
MxHashTable<MxVariable>::Add(var);
|
MxHashTable<MxVariable>::Add(var);
|
||||||
@ -68,7 +68,7 @@ const char *MxVariableTable::GetVariable(const char *p_key)
|
|||||||
delete var;
|
delete var;
|
||||||
|
|
||||||
if (found) {
|
if (found) {
|
||||||
cursor.GetMatch(&var);
|
cursor.GetMatch(var);
|
||||||
value = var->GetValue()->GetData();
|
value = var->GetValue()->GetData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,9 +11,9 @@
|
|||||||
class MxVariableTable : protected MxHashTable<MxVariable>
|
class MxVariableTable : protected MxHashTable<MxVariable>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
__declspec(dllexport) const char * GetVariable(const char *key);
|
|
||||||
__declspec(dllexport) void SetVariable(MxVariable *var);
|
|
||||||
__declspec(dllexport) void SetVariable(const char *key, const char *value);
|
__declspec(dllexport) void SetVariable(const char *key, const char *value);
|
||||||
|
__declspec(dllexport) void SetVariable(MxVariable *var);
|
||||||
|
__declspec(dllexport) const char * GetVariable(const char *key);
|
||||||
|
|
||||||
virtual MxS8 Compare(MxVariable *, MxVariable *); // +0x14
|
virtual MxS8 Compare(MxVariable *, MxVariable *); // +0x14
|
||||||
virtual MxU32 Hash(MxVariable *); // +0x18
|
virtual MxU32 Hash(MxVariable *); // +0x18
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user