[lib] Optimise owl_mac_equals()
MAC addresses are more likely to vary in the right octets than in the left octets, so we compare them starting from the end rather than from the beginning.
This commit is contained in:
parent
316db76861
commit
b594505ea7
|
@ -68,7 +68,7 @@ owl_bool owl_mac_equals(const uint8_t *const mac1,
|
|||
const uint8_t *const mac2)
|
||||
{
|
||||
int i ;
|
||||
for (i = 0 ; i < ETHER_ADDR_LEN ; ++i)
|
||||
for (i = ETHER_ADDR_LEN - 1 ; i >= 0 ; --i)
|
||||
if(mac1[i] != mac2[i])
|
||||
return owl_false ;
|
||||
return owl_true ;
|
||||
|
|
Loading…
Reference in New Issue