Commit ab03b906 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Micro-optimisation in find_destination.

parent d4dabe92
...@@ -36,6 +36,10 @@ find_destination(const unsigned char *d, int create, unsigned char seqno) ...@@ -36,6 +36,10 @@ find_destination(const unsigned char *d, int create, unsigned char seqno)
{ {
int i; int i;
for(i = 0; i < numdests; i++) { for(i = 0; i < numdests; i++) {
/* This should really be a hash table. For now, check the
last byte first. */
if(dests[i].address[15] != d[15])
continue;
if(memcmp(dests[i].address, d, 16) == 0) if(memcmp(dests[i].address, d, 16) == 0)
return &dests[i]; return &dests[i];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment