re-use same hash class for all add operations

This commit is contained in:
Bernhard Amann 2013-07-30 18:48:05 -07:00
parent 18c10f3cb5
commit 83ce77e575
3 changed files with 11 additions and 14 deletions

View file

@ -54,20 +54,7 @@ function hll_cardinality_add%(handle: opaque of cardinality, elem: any%): bool
return new Val(0, TYPE_BOOL);
}
int status = 0;
TypeList* tl = new TypeList(elem->Type());
tl->Append(elem->Type());
CompositeHash* hll_hash = new CompositeHash(tl);
Unref(tl);
HashKey* key = hll_hash->ComputeHash(elem, 1);
uint64_t hash = key->Hash();
CardinalityCounter* h = cv->Get();
h->addElement(hash);
delete hll_hash;
cv->Add(elem);
return new Val(1, TYPE_BOOL);
%}