Change default hashtable size
[iotcloud.git] / version2 / src / C / hashtable.h
index 91d1e5a465c9358364e547a7da55c1ee2b01645a..6107e339c3ea972e5997374708f999cb7b4d2b5c 100644 (file)
@@ -70,7 +70,7 @@ public:
         * @param factor Sets the percentage full before the hashtable is
         * resized. Default ratio 0.5.
         */
-       Hashtable(unsigned int initialcapacity = 1024, double factor = 0.5) {
+       Hashtable(unsigned int initialcapacity = 32, double factor = 0.5) {
                // Allocate space for the hash table
                table = (struct Hashlistnode<_Key, _Val> *)ourcalloc(initialcapacity, sizeof(struct Hashlistnode<_Key, _Val>));
                zero = NULL;
@@ -261,6 +261,7 @@ public:
                        tail = search;
                else
                        list->prev = search;
+               list = search;
                Size++;
                return (_Val) 0;
        }