performance: add few restict and const key words

This should make the run to be couple percentages quicker.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-11-05 21:05:42 +00:00
parent dbf3927c39
commit b61c93b7a1
3 changed files with 5 additions and 5 deletions

View file

@ -42,7 +42,7 @@
#include "dhcpd-pools.h"
/* Clean up data */
static int ip_sort(struct leases_t *a, struct leases_t *b)
static int ip_sort(const struct leases_t *restrict a, const struct leases_t *restrict b)
{
if (a->ip < b->ip)
return -1;
@ -61,8 +61,8 @@ int prepare_data(void)
/* Join leases and ranges into couter structs */
int do_counting(void)
{
struct range_t *range_p;
struct leases_t *l;
struct range_t *restrict range_p;
const struct leases_t *restrict l;
unsigned long i, k, block_size;
range_p = ranges;