diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-09-28 17:43:43 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-09-28 17:43:43 +0000 |
commit | c24574ef8ee137207b9abf4f462e6bda4c734c78 (patch) | |
tree | 8659a6eb0ebe2812a15fb0d2b4a9e48056499a08 | |
parent | 8329699095fd7a6446a8541363822695f7b691ee (diff) |
hostapd tree search speedup via inlined compare function
suggested by Mike Belopuhov (mkb at crypt dot org dot ru)
-rw-r--r-- | usr.sbin/hostapd/hostapd.c | 6 | ||||
-rw-r--r-- | usr.sbin/hostapd/hostapd.h | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/hostapd/hostapd.c b/usr.sbin/hostapd/hostapd.c index b00ef0e9e9e..75142247bab 100644 --- a/usr.sbin/hostapd/hostapd.c +++ b/usr.sbin/hostapd/hostapd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hostapd.c,v 1.29 2006/06/01 22:09:09 reyk Exp $ */ +/* $OpenBSD: hostapd.c,v 1.30 2006/09/28 17:43:42 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org> @@ -52,6 +52,8 @@ void hostapd_usage(void); void hostapd_udp_init(struct hostapd_config *); void hostapd_sig_handler(int); +static __inline int + hostapd_entry_cmp(struct hostapd_entry *, struct hostapd_entry *); struct hostapd_config hostapd_cfg; @@ -612,7 +614,7 @@ hostapd_entry_update(struct hostapd_table *table, struct hostapd_entry *entry) } } -int +static __inline int hostapd_entry_cmp(struct hostapd_entry *a, struct hostapd_entry *b) { return (memcmp(a->e_lladdr, b->e_lladdr, IEEE80211_ADDR_LEN)); diff --git a/usr.sbin/hostapd/hostapd.h b/usr.sbin/hostapd/hostapd.h index e29f460e631..3048c3a9d18 100644 --- a/usr.sbin/hostapd/hostapd.h +++ b/usr.sbin/hostapd/hostapd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hostapd.h,v 1.18 2006/06/27 18:14:59 reyk Exp $ */ +/* $OpenBSD: hostapd.h,v 1.19 2006/09/28 17:43:42 reyk Exp $ */ /* * Copyright (c) 2004, 2005 Reyk Floeter <reyk@openbsd.org> @@ -382,7 +382,6 @@ struct hostapd_entry *hostapd_entry_lookup(struct hostapd_table *, u_int8_t *); void hostapd_entry_update(struct hostapd_table *, struct hostapd_entry *); -int hostapd_entry_cmp(struct hostapd_entry *, struct hostapd_entry *); RB_PROTOTYPE(hostapd_tree, hostapd_entry, e_nodes, hostapd_entry_cmp); |