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

4
expr.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.30 2009/08/08 13:08:50 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.31 2009/08/28 20:30:55 tg Exp $");
/* The order of these enums is constrained by the order of opinfo[] */
enum token {
@ -608,6 +608,8 @@ tempvar(void)
vp->flag = ISSET|INTEGER;
vp->type = 0;
vp->areap = ATEMP;
vp->tablep = NULL;
vp->hval = 0;
vp->val.i = 0;
vp->name[0] = '\0';
return (vp);