Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tjsHashSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class tTJSHashFunc
{
const char *p = (const char*)&val;
const char *plim = (const char*)&val + sizeof(T);
register tjs_uint32 ret = 0;
tjs_uint32 ret = 0;
while(p<plim)
{
ret += *p;
Expand Down Expand Up @@ -616,27 +616,27 @@ class tTJSHashCache : public tTJSHashTable<KeyT, ValueT, HashFuncT, HashSize>
void Add(const KeyT &key, const ValueT &value)
{
inherited::Add(key, value);
if(GetCount() > MaxCount)
if(inherited::GetCount() > MaxCount)
{
ChopLast(GetCount() - MaxCount);
inherited::ChopLast(inherited::GetCount() - MaxCount);
}
}

void AddWithHash(const KeyT &key, tjs_uint32 hash, const ValueT &value)
{
inherited::AddWithHash(key, hash, value);
if(GetCount() > MaxCount)
if(inherited::GetCount() > MaxCount)
{
ChopLast(GetCount() - MaxCount);
inherited::ChopLast(inherited::GetCount() - MaxCount);
}
}

void SetMaxCount(tjs_uint maxcount)
{
MaxCount = maxcount;
if(GetCount() > MaxCount)
if(inherited::GetCount() > MaxCount)
{
ChopLast(GetCount() - MaxCount);
inherited::ChopLast(inherited::GetCount() - MaxCount);
}
}

Expand Down