diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-12-11 18:53:17 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-12-11 23:38:00 +0100 |
commit | 43d6047c400041e4783a76017d21b763df988d92 (patch) | |
tree | d774150194825a3f34ead5782f40b58e199bb92b /ubusd_id.c | |
parent | 9f706a2d27719ff39bbe71472f48a791ec306164 (diff) | |
download | ubus-43d6047c400041e4783a76017d21b763df988d92.tar.gz |
ubusd: use avl_strcmp
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'ubusd_id.c')
-rw-r--r-- | ubusd_id.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -15,6 +15,7 @@ #include <stdlib.h> #include <unistd.h> #include <fcntl.h> +#include <libubox/avl-cmp.h> #include "ubusmsg.h" #include "ubusd_id.h" @@ -31,14 +32,9 @@ static int ubus_cmp_id(const void *k1, const void *k2, void *ptr) return *id1 > *id2; } -static int ubus_cmp_str(const void *k1, const void *k2, void *ptr) -{ - return strcmp(k1, k2); -} - void ubus_init_string_tree(struct avl_tree *tree, bool dup) { - avl_init(tree, ubus_cmp_str, dup, NULL); + avl_init(tree, avl_strcmp, dup, NULL); } void ubus_init_id_tree(struct avl_tree *tree) |