much better solution: save tablep and hash value¹ in the struct tbl entry

① also saves time during texpand :D

XXX this doesn’t work well with the current indexed-array implementation
This commit is contained in:
tg
2009-08-28 20:30:59 +00:00
parent 7240c843ce
commit 4ccdfc8508
10 changed files with 108 additions and 110 deletions

5
edit.c
View File

@ -25,7 +25,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.174 2009/08/28 19:57:39 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.175 2009/08/28 20:30:54 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -4161,8 +4161,7 @@ vi_cmd(int argcnt, const char *cmd)
/* lookup letter in alias list... */
alias[1] = cmd[1];
ap = ktsearch(&aliases, alias, hash(alias),
NULL);
ap = ktsearch(&aliases, alias, hash(alias));
if (!cmd[1] || !ap || !(ap->flag & ISSET))
return (-1);
/* check if this is a recursive call... */