Hashtable update

- use consistent type for key by introducing a new typedef
- use unsigned types for sizes
- name parameters in foreach function typedef
This commit is contained in:
Christian Göttsche
2020-10-21 21:25:59 +02:00
committed by BenBE
parent 15eab2012d
commit 7914ec201e
5 changed files with 31 additions and 29 deletions

View File

@ -60,14 +60,14 @@ static bool Vector_isConsistent(const Vector* this) {
}
}
int Vector_count(const Vector* this) {
int items = 0;
unsigned int Vector_count(const Vector* this) {
unsigned int items = 0;
for (int i = 0; i < this->items; i++) {
if (this->array[i]) {
items++;
}
}
assert(items == this->items);
assert(items == (unsigned int)this->items);
return items;
}