Sync OpenBSD patchset 1008:

Use RB trees not SPLAY.
This commit is contained in:
Tiago Cunha
2012-01-21 19:38:26 +00:00
parent a7b0b30bdd
commit a3c1b730c9
7 changed files with 43 additions and 43 deletions

View File

@ -107,7 +107,7 @@ cmd_bind_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) {
if ((mbind = RB_FIND(mode_key_tree, mtab->tree, &mtmp)) != NULL) {
mbind->cmd = cmd;
return (0);
}
@ -115,6 +115,6 @@ cmd_bind_key_table(struct cmd *self, struct cmd_ctx *ctx, int key)
mbind->key = mtmp.key;
mbind->mode = mtmp.mode;
mbind->cmd = cmd;
SPLAY_INSERT(mode_key_tree, mtab->tree, mbind);
RB_INSERT(mode_key_tree, mtab->tree, mbind);
return (0);
}