Kaydet (Commit) 6bbe55c4 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Simplify code

Change-Id: Ib35cba4544726c1653d36072f3499dffec3cced3
üst 0dd3b8b2
......@@ -121,37 +121,20 @@ extern "C" rtl_Locale* rtl_hashtable_add(RTL_HASHTABLE** table, rtl_Locale* valu
key = rtl_hashfunc(*table, value->HashCode);
if (!(*table)->Table[key])
RTL_HASHENTRY **pEntry = &(*table)->Table[key];
while (*pEntry)
{
RTL_HASHENTRY *newEntry = (RTL_HASHENTRY*)rtl_allocateMemory( sizeof(RTL_HASHENTRY) );
newEntry->Entry = value;
newEntry->Next = NULL;
(*table)->Table[key] = newEntry;
(*table)->Elements++;
return NULL;
} else
{
RTL_HASHENTRY *pEntry = (*table)->Table[key];
RTL_HASHENTRY *newEntry = NULL;
while (pEntry)
{
if (value->HashCode == pEntry->Entry->HashCode)
return pEntry->Entry;
if (!pEntry->Next)
break;
pEntry = pEntry->Next;
}
newEntry = (RTL_HASHENTRY*)rtl_allocateMemory( sizeof(RTL_HASHENTRY) );
newEntry->Entry = value;
newEntry->Next = NULL;
pEntry->Next = newEntry;
(*table)->Elements++;
return NULL;
if (value->HashCode == (*pEntry)->Entry->HashCode)
return (*pEntry)->Entry;
pEntry = &(*pEntry)->Next;
}
RTL_HASHENTRY *newEntry = (RTL_HASHENTRY*)rtl_allocateMemory( sizeof(RTL_HASHENTRY) );
newEntry->Entry = value;
newEntry->Next = NULL;
*pEntry = newEntry;
(*table)->Elements++;
return NULL;
}
sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment