diff options
author | Sverker Eriksson <[email protected]> | 2015-11-13 18:04:09 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-11-27 19:28:26 +0100 |
commit | 99e6213c0f0cebaa01f8310b6950a814cf4b21ee (patch) | |
tree | 4cea14183b77db375eb24f668d8afaa0d93f98d7 /erts | |
parent | 80bbe3b23ad7781e43dfea3a84203956ccab6a10 (diff) | |
download | otp-99e6213c0f0cebaa01f8310b6950a814cf4b21ee.tar.gz otp-99e6213c0f0cebaa01f8310b6950a814cf4b21ee.tar.bz2 otp-99e6213c0f0cebaa01f8310b6950a814cf4b21ee.zip |
erts: Remove dead code erts_hash_merge
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/hash.c | 50 | ||||
-rw-r--r-- | erts/emulator/beam/hash.h | 2 |
2 files changed, 0 insertions, 52 deletions
diff --git a/erts/emulator/beam/hash.c b/erts/emulator/beam/hash.c index e0fde337f2..636aafc108 100644 --- a/erts/emulator/beam/hash.c +++ b/erts/emulator/beam/hash.c @@ -280,56 +280,6 @@ void* hash_put(Hash* h, void* tmpl) return (void*) b; } -static void -hash_insert_entry(Hash* h, HashBucket* entry) -{ - HashValue hval = entry->hvalue; - int ix = hval % h->size; - HashBucket* b = h->bucket[ix]; - - while (b != (HashBucket*) 0) { - if ((b->hvalue == hval) && (h->fun.cmp((void*)entry, (void*)b) == 0)) { - abort(); /* Should not happen */ - } - b = b->next; - } - - if (h->bucket[ix] == NULL) - h->used++; - - entry->next = h->bucket[ix]; - h->bucket[ix] = entry; - - if (h->used > h->size80percent) /* rehash at 80% */ - rehash(h, 1); -} - - -/* - * Move all entries in src into dst; empty src. - * Entries in src must not exist in dst. - */ -void -erts_hash_merge(Hash* src, Hash* dst) -{ - int limit = src->size; - HashBucket** bucket = src->bucket; - int i; - - src->used = 0; - for (i = 0; i < limit; i++) { - HashBucket* b = bucket[i]; - HashBucket* next; - - bucket[i] = NULL; - while (b) { - next = b->next; - hash_insert_entry(dst, b); - b = next; - } - } -} - /* ** Erase hash entry return template if erased ** return 0 if not erased diff --git a/erts/emulator/beam/hash.h b/erts/emulator/beam/hash.h index 87fdb360e3..c9e75d7acf 100644 --- a/erts/emulator/beam/hash.h +++ b/erts/emulator/beam/hash.h @@ -93,6 +93,4 @@ void* hash_erase(Hash*, void*); void* hash_remove(Hash*, void*); void hash_foreach(Hash*, void (*func)(void *, void *), void *); -void erts_hash_merge(Hash* src, Hash* dst); - #endif |