]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: virhash: Remove virHashTableSize
authorPeter Krempa <pkrempa@redhat.com>
Tue, 20 Oct 2020 14:32:54 +0000 (16:32 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 22 Oct 2020 13:02:46 +0000 (15:02 +0200)
It's used only in one place in tests which isn't even automatically
evaluated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/libvirt_private.syms
src/util/virhash.c
src/util/virhash.h
tests/virhashtest.c

index b2d786409bd691d778fffdd105c01fe9f3be1213..79c840320802494433c8a4a55e1a8e8fc9593ee1 100644 (file)
@@ -2213,7 +2213,6 @@ virHashRemoveSet;
 virHashSearch;
 virHashSize;
 virHashSteal;
-virHashTableSize;
 virHashUpdateEntry;
 virHashValueFree;
 
index 4b503a03132a89fa85d5ab8e972089b50240f214..7dd2d9f81db4ac448a3b8d7b98447323674efaa9 100644 (file)
@@ -549,23 +549,6 @@ virHashSize(const virHashTable *table)
     return table->nbElems;
 }
 
-/**
- * virHashTableSize:
- * @table: the hash table
- *
- * Query the size of the hash @table, i.e., number of buckets in the table.
- *
- * Returns the number of keys in the hash table or
- * -1 in case of error
- */
-ssize_t
-virHashTableSize(const virHashTable *table)
-{
-    if (table == NULL)
-        return -1;
-    return table->size;
-}
-
 
 /**
  * virHashRemoveEntry:
index cb59fb639ba0c855530d62215257a7ed794693f2..37853aba36edbf6680504af10adab2d744a6a6c0 100644 (file)
@@ -125,7 +125,6 @@ virHashTablePtr virHashCreateFull(ssize_t size,
                                   virHashKeyFree keyFree);
 void virHashFree(virHashTablePtr table);
 ssize_t virHashSize(const virHashTable *table);
-ssize_t virHashTableSize(const virHashTable *table);
 
 /*
  * Add a new entry to the hash table.
index af3079124109ba2bbb2ef6dea179786f135e181d..7b1b8dd38c8b343273ac4b098a03e0dae2522180 100644 (file)
@@ -27,16 +27,10 @@ testHashInit(int size)
      * collision list in the same order as in the uuids array
      */
     for (i = G_N_ELEMENTS(uuids) - 1; i >= 0; i--) {
-        ssize_t oldsize = virHashTableSize(hash);
         if (virHashAddEntry(hash, uuids[i], (void *) uuids[i]) < 0) {
             virHashFree(hash);
             return NULL;
         }
-
-        if (virHashTableSize(hash) != oldsize) {
-            VIR_TEST_DEBUG("hash grown from %zu to %zu",
-                     (size_t)oldsize, (size_t)virHashTableSize(hash));
-        }
     }
 
     for (i = 0; i < G_N_ELEMENTS(uuids); i++) {