Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
[Refactoring] Remove code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Nov 16, 2014
1 parent ff96595 commit 9e410b0
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/rt/aaA.d
Expand Up @@ -242,28 +242,7 @@ Lret:
*/
inout(void)* _aaGetRvalueX(inout AA aa, in TypeInfo keyti, in size_t valuesize, in void* pkey)
{
//printf("_aaGetRvalue(valuesize = %u)\n", valuesize);
if (aa.impl is null)
return null;

if (immutable len = aa.impl.buckets.length)
{
immutable key_hash = keyti.getHash(pkey);
immutable i = key_hash % len;
//printf("hash = %d\n", key_hash);

inout(Entry)* e = aa.impl.buckets[i];
while (e !is null)
{
if (key_hash == e.hash)
{
if (keyti.equals(pkey, e + 1))
return cast(inout void*)(e + 1) + aligntsize(keyti.tsize);
}
e = e.next;
}
}
return null; // not found, caller will throw exception
return _aaInX(aa, keyti, pkey);
}


Expand Down

0 comments on commit 9e410b0

Please sign in to comment.