X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=hashtable.h;fp=hashtable.h;h=84baaba1e90646f8f71f1bb10cd1360e44315a70;hb=e32494ed2cfb8353b7ccfab60a89421314ee9068;hp=8427f6724318027bac7203ab570d66290900a384;hpb=c7d1fa37dfd38155acd2137fbeb9b7e5703fb3dc;p=model-checker.git diff --git a/hashtable.h b/hashtable.h index 8427f67..84baaba 100644 --- a/hashtable.h +++ b/hashtable.h @@ -116,7 +116,7 @@ template * bin = table[i]; while(bin!=NULL) { struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> * next=bin->next; @@ -130,11 +130,8 @@ template threshold) { - //Resize - unsigned int newsize = capacity << 1; - resize(newsize); - } + if (size > threshold) + resize(capacity << 1); struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *ptr = table[(((_KeyInt)key) & mask)>>_Shift]; size++; @@ -157,11 +154,8 @@ template threshold) { - //Resize - unsigned int newsize = capacity << 1; - resize(newsize); - } + if (size > threshold) + resize(capacity << 1); struct hashlistnode<_Key,_Val, _malloc, _calloc, _free> *ptr = table[(((_KeyInt)key) & mask)>>_Shift]; size++;