X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=hashtable.h;h=c9da5aad4341883bba7225f3bc97f1f2bd04fc9f;hb=926e6a993b8d578b3ccb763bcc8adb699d9059df;hp=16744bb45f39e89a165bf12a804c96cad466123b;hpb=110873aa95a98a28561165f803d21a9b050205ed;p=c11tester.git diff --git a/hashtable.h b/hashtable.h index 16744bb4..c9da5aad 100644 --- a/hashtable.h +++ b/hashtable.h @@ -62,7 +62,7 @@ inline bool default_equals(_Key key1, _Key key2) { * @tparam _free Provide your own 'free' for the table, or default to * snapshotting. */ -template, bool (*equals)(_Key, _Key) = default_equals<_Key> > +template, bool (*equals)(_Key, _Key) = default_equals<_Key> > class HashTable { public: /** @@ -81,7 +81,7 @@ public: capacitymask = initialcapacity - 1; threshold = (unsigned int)(initialcapacity * loadfactor); - size = 0; // Initial number of elements in the hash + size = 0; // Initial number of elements in the hash } /** @brief Hash table destructor */ @@ -327,7 +327,7 @@ public: exit(EXIT_FAILURE); } - table = newtable; // Update the global hashtable upon resize() + table = newtable; // Update the global hashtable upon resize() capacity = newsize; capacitymask = newsize - 1; @@ -353,7 +353,7 @@ public: search->val = bin->val; } - _free(oldtable); // Free the memory of the old hash table + _free(oldtable); // Free the memory of the old hash table } double getLoadFactor() {return loadfactor;} unsigned int getCapacity() {return capacity;} @@ -367,4 +367,4 @@ private: double loadfactor; }; -#endif/* __HASHTABLE_H__ */ +#endif /* __HASHTABLE_H__ */