From 25c4656a515d1e862085669fa693bbbfbbf2c315 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 11 Mar 2024 01:02:43 +0100 Subject: [PATCH] remove index because it's literally the same as comparisons --- lab01/zad2/include/linked_list.h | 1 - lab01/zad2/src/linked_list.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/lab01/zad2/include/linked_list.h b/lab01/zad2/include/linked_list.h index 39bbe2c..54e3a1b 100644 --- a/lab01/zad2/include/linked_list.h +++ b/lab01/zad2/include/linked_list.h @@ -17,7 +17,6 @@ typedef struct { typedef struct { bool success; - size_t index; size_t comparisons; } SearchResult; diff --git a/lab01/zad2/src/linked_list.c b/lab01/zad2/src/linked_list.c index 498d234..a96335f 100644 --- a/lab01/zad2/src/linked_list.c +++ b/lab01/zad2/src/linked_list.c @@ -64,7 +64,6 @@ LinkedList linked_list_merge(LinkedList l1, LinkedList l2) { SearchResult linked_list_search(LinkedList l, void *value, int (*compare_values)(void *v1, void *v2)) { SearchResult result; result.comparisons = 0; - result.index = 0; result.success = false; Node *current = l.head; @@ -74,7 +73,6 @@ SearchResult linked_list_search(LinkedList l, void *value, int (*compare_values) result.success = true; break; } - result.index += 1; current = current->next; } while (current != l.head);