diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-01-21 11:12:14 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-01-21 11:12:14 +0000 |
commit | 1df0d8faf0045e8f11d397af7c66860577ac377c (patch) | |
tree | 6c99b1952ae374d8f8ac5480a120419f3f81772d /usr.bin/tmux/mode-key.c | |
parent | 81fb1528cdaec5b3d9d2f1244cf56c5272343b3e (diff) |
Use RB trees not SPLAY.
Diffstat (limited to 'usr.bin/tmux/mode-key.c')
-rw-r--r-- | usr.bin/tmux/mode-key.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/mode-key.c b/usr.bin/tmux/mode-key.c index 4e52a5cb9e2..e37970c77ff 100644 --- a/usr.bin/tmux/mode-key.c +++ b/usr.bin/tmux/mode-key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mode-key.c,v 1.43 2012/01/20 19:10:29 nicm Exp $ */ +/* $OpenBSD: mode-key.c,v 1.44 2012/01/21 11:12:13 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -412,7 +412,7 @@ const struct mode_key_table mode_key_tables[] = { { NULL, NULL, NULL, NULL } }; -SPLAY_GENERATE(mode_key_tree, mode_key_binding, entry, mode_key_cmp); +RB_GENERATE(mode_key_tree, mode_key_binding, entry, mode_key_cmp); int mode_key_cmp(struct mode_key_binding *mbind1, struct mode_key_binding *mbind2) @@ -462,13 +462,13 @@ mode_key_init_trees(void) struct mode_key_binding *mbind; for (mtab = mode_key_tables; mtab->name != NULL; mtab++) { - SPLAY_INIT(mtab->tree); + RB_INIT(mtab->tree); for (ment = mtab->table; ment->mode != -1; ment++) { mbind = xmalloc(sizeof *mbind); mbind->key = ment->key; mbind->mode = ment->mode; mbind->cmd = ment->cmd; - SPLAY_INSERT(mode_key_tree, mtab->tree, mbind); + RB_INSERT(mode_key_tree, mtab->tree, mbind); } } } @@ -487,7 +487,7 @@ mode_key_lookup(struct mode_key_data *mdata, int key) mtmp.key = key; mtmp.mode = mdata->mode; - if ((mbind = SPLAY_FIND(mode_key_tree, mdata->tree, &mtmp)) == NULL) { + if ((mbind = RB_FIND(mode_key_tree, mdata->tree, &mtmp)) == NULL) { if (mdata->mode != 0) return (MODEKEY_NONE); return (MODEKEY_OTHER); |