Skip to content

Commit

Permalink
Removing unnecessary indirection
Browse files Browse the repository at this point in the history
  • Loading branch information
srdja committed Jan 28, 2024
1 parent a005e3b commit 61bcd01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cc_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ static INLINE void merge(Node **left, Node **right, size_t l_size,

size_t i;
for (i = 0; i < size; i++) {
int c = cmp(&(l_part->data), &(r_part->data));
int c = cmp(l_part->data, r_part->data);

if ((c < 0 || c == 0)) {
/* The two partitions are already sorted. */
Expand Down
4 changes: 2 additions & 2 deletions test/list_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

int cmp(void const* e1, void const* e2)
{
int i = *(*((int**)e1));
int j = *(*((int**)e2));
int i = *((int*)e1);
int j = *((int*)e2);

if (i < j)
return -1;
Expand Down

0 comments on commit 61bcd01

Please sign in to comment.