X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=hashtable.h;h=2b703c595a9377c37a4e43792bba6e9d67873afd;hb=18e9e9e8f1bc9c12049520498e06e24d25d8d72d;hp=84baaba1e90646f8f71f1bb10cd1360e44315a70;hpb=e32494ed2cfb8353b7ccfab60a89421314ee9068;p=model-checker.git diff --git a/hashtable.h b/hashtable.h index 84baaba..2b703c5 100644 --- a/hashtable.h +++ b/hashtable.h @@ -134,7 +134,6 @@ template *ptr = table[(((_KeyInt)key) & mask)>>_Shift]; - size++; struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *search = ptr; while(search!=NULL) { @@ -150,6 +149,7 @@ templateval=val; newptr->next=ptr; table[(((_KeyInt)key)&mask)>>_Shift]=newptr; + size++; } /** Put a key entry into the table. */ @@ -158,7 +158,6 @@ template *ptr = table[(((_KeyInt)key) & mask)>>_Shift]; - size++; struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *search = ptr; while(search!=NULL) { @@ -172,6 +171,7 @@ templatekey=key; newptr->next=ptr; table[(((_KeyInt)key)&mask)>>_Shift]=newptr; + size++; return &newptr->val; }