diff --git a/Vector.c b/Vector.c index a12d6bb5..aa316805 100644 --- a/Vector.c +++ b/Vector.c @@ -288,9 +288,9 @@ void Vector_add(Vector* this, void* data_) { assert(Vector_isConsistent(this)); } -int Vector_indexOf(Vector* this, void* search_, Object_Compare compare) { - Object* search = search_; - assert(Object_isA((Object*)search, this->type)); +int Vector_indexOf(Vector* this, const void* search_, Object_Compare compare) { + const Object* search = search_; + assert(Object_isA(search, this->type)); assert(compare); assert(Vector_isConsistent(this)); for (int i = 0; i < this->items; i++) { diff --git a/Vector.h b/Vector.h index d0d42c6c..1b599d69 100644 --- a/Vector.h +++ b/Vector.h @@ -61,7 +61,7 @@ int Vector_count(Vector* this); 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);