aboutsummaryrefslogtreecommitdiffstats
path: root/Hashtable.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:22 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:22 +0200
commitc74c38760df69bb87e93dff18cf91464e5d02f37 (patch)
treeee2a19a0ef3a808bdfc8c1e6a00e96d79966dcb0 /Hashtable.c
parent9379132a8234eeedf62d37ef57713e52c12db6ab (diff)
downloaddebian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.tar.gz
debian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.tar.bz2
debian_htop-c74c38760df69bb87e93dff18cf91464e5d02f37.zip
Imported Upstream version 0.8.1upstream/0.8.1
Diffstat (limited to 'Hashtable.c')
-rw-r--r--Hashtable.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Hashtable.c b/Hashtable.c
index cfd1470..057518c 100644
--- a/Hashtable.c
+++ b/Hashtable.c
@@ -34,7 +34,7 @@ struct Hashtable_ {
#ifdef DEBUG
-bool Hashtable_isConsistent(Hashtable* this) {
+static bool Hashtable_isConsistent(Hashtable* this) {
int items = 0;
for (int i = 0; i < this->size; i++) {
HashtableItem* bucket = this->buckets[i];
@@ -61,7 +61,7 @@ int Hashtable_count(Hashtable* this) {
#endif
-HashtableItem* HashtableItem_new(unsigned int key, void* value) {
+static HashtableItem* HashtableItem_new(unsigned int key, void* value) {
HashtableItem* this;
this = (HashtableItem*) malloc(sizeof(HashtableItem));
@@ -99,11 +99,6 @@ void Hashtable_delete(Hashtable* this) {
free(this);
}
-inline int Hashtable_size(Hashtable* this) {
- assert(Hashtable_isConsistent(this));
- return this->items;
-}
-
void Hashtable_put(Hashtable* this, unsigned int key, void* value) {
unsigned int index = key % this->size;
HashtableItem** bucketPtr = &(this->buckets[index]);

© 2014-2024 Faster IT GmbH | imprint | privacy policy