1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

util: virhash: Remove virHashTableSize

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>
This commit is contained in:
Peter Krempa 2020-10-20 16:32:54 +02:00
parent 0778cff2ae
commit 2751b9757b
4 changed files with 0 additions and 25 deletions

View File

@ -2213,7 +2213,6 @@ virHashRemoveSet;
virHashSearch; virHashSearch;
virHashSize; virHashSize;
virHashSteal; virHashSteal;
virHashTableSize;
virHashUpdateEntry; virHashUpdateEntry;
virHashValueFree; virHashValueFree;

View File

@ -549,23 +549,6 @@ virHashSize(const virHashTable *table)
return table->nbElems; 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: * virHashRemoveEntry:

View File

@ -125,7 +125,6 @@ virHashTablePtr virHashCreateFull(ssize_t size,
virHashKeyFree keyFree); virHashKeyFree keyFree);
void virHashFree(virHashTablePtr table); void virHashFree(virHashTablePtr table);
ssize_t virHashSize(const virHashTable *table); ssize_t virHashSize(const virHashTable *table);
ssize_t virHashTableSize(const virHashTable *table);
/* /*
* Add a new entry to the hash table. * Add a new entry to the hash table.

View File

@ -27,16 +27,10 @@ testHashInit(int size)
* collision list in the same order as in the uuids array * collision list in the same order as in the uuids array
*/ */
for (i = G_N_ELEMENTS(uuids) - 1; i >= 0; i--) { for (i = G_N_ELEMENTS(uuids) - 1; i >= 0; i--) {
ssize_t oldsize = virHashTableSize(hash);
if (virHashAddEntry(hash, uuids[i], (void *) uuids[i]) < 0) { if (virHashAddEntry(hash, uuids[i], (void *) uuids[i]) < 0) {
virHashFree(hash); virHashFree(hash);
return NULL; 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++) { for (i = 0; i < G_N_ELEMENTS(uuids); i++) {