diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-01-21 11:12:13 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-01-21 11:12:13 +0000 |
commit | 8ed9124f3fd307a26b2b5032b02b05fe7ede023b (patch) | |
tree | 2d9e1897c93b8c529cb57aa064df061735bf2c0b /mode-key.c | |
parent | 535286c05aee55c0127cdabada8e54582905ef8e (diff) | |
download | rtmux-8ed9124f3fd307a26b2b5032b02b05fe7ede023b.tar.gz rtmux-8ed9124f3fd307a26b2b5032b02b05fe7ede023b.tar.bz2 rtmux-8ed9124f3fd307a26b2b5032b02b05fe7ede023b.zip |
Use RB trees not SPLAY.
Diffstat (limited to 'mode-key.c')
-rw-r--r-- | mode-key.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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); |