mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-09 21:57:37 +02:00
Use RB trees not SPLAY.
This commit is contained in:
@ -57,8 +57,8 @@ cmd_unbind_key_exec(struct cmd *self, unused struct cmd_ctx *ctx)
|
||||
int key;
|
||||
|
||||
if (args_has(args, 'a')) {
|
||||
while (!SPLAY_EMPTY(&key_bindings)) {
|
||||
bd = SPLAY_ROOT(&key_bindings);
|
||||
while (!RB_EMPTY(&key_bindings)) {
|
||||
bd = RB_ROOT(&key_bindings);
|
||||
key_bindings_remove(bd->key);
|
||||
}
|
||||
return (0);
|
||||
@ -95,8 +95,8 @@ cmd_unbind_key_table(struct cmd *self, struct cmd_ctx *ctx, int key)
|
||||
|
||||
mtmp.key = key;
|
||||
mtmp.mode = !!args_has(args, 'c');
|
||||
if ((mbind = SPLAY_FIND(mode_key_tree, mtab->tree, &mtmp)) != NULL) {
|
||||
SPLAY_REMOVE(mode_key_tree, mtab->tree, mbind);
|
||||
if ((mbind = RB_FIND(mode_key_tree, mtab->tree, &mtmp)) != NULL) {
|
||||
RB_REMOVE(mode_key_tree, mtab->tree, mbind);
|
||||
xfree(mbind);
|
||||
}
|
||||
return (0);
|
||||
|
Reference in New Issue
Block a user