remove index because it's literally the same as comparisons

This commit is contained in:
jacekpoz 2024-03-11 01:02:43 +01:00
parent 73b5777b88
commit 25c4656a51
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
2 changed files with 0 additions and 3 deletions

View file

@ -17,7 +17,6 @@ typedef struct {
typedef struct { typedef struct {
bool success; bool success;
size_t index;
size_t comparisons; size_t comparisons;
} SearchResult; } SearchResult;

View file

@ -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 linked_list_search(LinkedList l, void *value, int (*compare_values)(void *v1, void *v2)) {
SearchResult result; SearchResult result;
result.comparisons = 0; result.comparisons = 0;
result.index = 0;
result.success = false; result.success = false;
Node *current = l.head; Node *current = l.head;
@ -74,7 +73,6 @@ SearchResult linked_list_search(LinkedList l, void *value, int (*compare_values)
result.success = true; result.success = true;
break; break;
} }
result.index += 1;
current = current->next; current = current->next;
} while (current != l.head); } while (current != l.head);