mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 08:16:59 +00:00
analyze: use simpler comparison
In some cases the this can make run time to take 2.5% less time. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
5714e95228
commit
7a86746710
1 changed files with 3 additions and 1 deletions
|
|
@ -66,11 +66,13 @@ int do_counting(void)
|
||||||
unsigned long i, k, block_size;
|
unsigned long i, k, block_size;
|
||||||
|
|
||||||
range_p = ranges;
|
range_p = ranges;
|
||||||
|
unsigned long r_end;
|
||||||
|
|
||||||
/* Walk through ranges */
|
/* Walk through ranges */
|
||||||
for (i = 0; i < num_ranges; i++) {
|
for (i = 0; i < num_ranges; i++) {
|
||||||
/* Count IPs in use */
|
/* Count IPs in use */
|
||||||
for (l = leases; l != NULL && range_p->last_ip >= l->ip; l = l->hh.next) {
|
r_end = range_p->last_ip + 1;
|
||||||
|
for (l = leases; l != NULL && l->ip < r_end; l = l->hh.next) {
|
||||||
if (l->ip < range_p->first_ip) {
|
if (l->ip < range_p->first_ip) {
|
||||||
/* should not be necessary */
|
/* should not be necessary */
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue