From a594ea35a36e644d3bd7235352857b2c9f87973a Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Wed, 11 Nov 2020 20:38:08 +0100 Subject: zusätzliches Argument beim linearen Suchen hinzugefügt, damit die Schnittstellen wieder identisch sind! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arraylist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arraylist.c b/arraylist.c index 982e466..f72d3e2 100644 --- a/arraylist.c +++ b/arraylist.c @@ -194,14 +194,14 @@ ArrayList_sort(struct ArrayList *arrayList, int cmp(const T *, const T *, void * } bool -ArrayList_linearSearch(struct ArrayList *arrayList, void *key, int cmp(void *, const T *), size_t *loc) +ArrayList_linearSearch(struct ArrayList *arrayList, void *key, int cmp(void *, const T *, void *), void *args, size_t *loc) { assert(arrayList != NULL); assert(cmp != NULL); assert(loc != NULL); for ( size_t idx = 0; idx != arrayList->size; ++idx ) { - if ( cmp(key, arrayList->array[idx]) == 0 ) { + if ( cmp(key, arrayList->array[idx], args) == 0 ) { *loc = idx; return true; } -- cgit v1.3