Mark search parameter in Vector_indexOf const

This commit is contained in:
Christian Göttsche 2020-10-14 15:19:23 +02:00 committed by cgzones
parent 2f9381d867
commit bfa7d1fbe2
2 changed files with 4 additions and 4 deletions

View File

@ -288,9 +288,9 @@ void Vector_add(Vector* this, void* data_) {
assert(Vector_isConsistent(this)); assert(Vector_isConsistent(this));
} }
int Vector_indexOf(Vector* this, void* search_, Object_Compare compare) { int Vector_indexOf(Vector* this, const void* search_, Object_Compare compare) {
Object* search = search_; const Object* search = search_;
assert(Object_isA((Object*)search, this->type)); assert(Object_isA(search, this->type));
assert(compare); assert(compare);
assert(Vector_isConsistent(this)); assert(Vector_isConsistent(this));
for (int i = 0; i < this->items; i++) { for (int i = 0; i < this->items; i++) {

View File

@ -61,7 +61,7 @@ int Vector_count(Vector* this);
void Vector_add(Vector* this, void* data_); void Vector_add(Vector* this, void* data_);
int Vector_indexOf(Vector* this, void* search_, Object_Compare compare); int Vector_indexOf(Vector* this, const void* search_, Object_Compare compare);
void Vector_splice(Vector* this, Vector* from); void Vector_splice(Vector* this, Vector* from);