mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 07:47:00 +00:00
sort: fix if else return statements
If something is true, and it returns using else is pointless. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
18f2835fd5
commit
629796cce7
1 changed files with 4 additions and 6 deletions
10
src/sort.c
10
src/sort.c
|
|
@ -48,10 +48,9 @@ int intcomp(const void *restrict x, const void *restrict y)
|
|||
{
|
||||
if (*(uint32_t *) x < *(uint32_t *) y)
|
||||
return -1;
|
||||
else if (*(uint32_t *) y < *(uint32_t *) x)
|
||||
if (*(uint32_t *) y < *(uint32_t *) x)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rangecomp(const void *restrict r1, const void *restrict r2)
|
||||
|
|
@ -59,11 +58,10 @@ int rangecomp(const void *restrict r1, const void *restrict r2)
|
|||
if ((((struct range_t *)r1)->first_ip) <
|
||||
(((struct range_t *)r2)->first_ip))
|
||||
return -1;
|
||||
else if ((((struct range_t *)r2)->first_ip) <
|
||||
if ((((struct range_t *)r2)->first_ip) <
|
||||
(((struct range_t *)r1)->first_ip))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned long int ret_ip(struct range_t r)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue