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
eval.c
View File

@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.65 2009/08/28 19:57:40 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.66 2009/08/28 20:30:55 tg Exp $");
/*
* string expansion
@ -1425,7 +1425,7 @@ homedir(char *name)
{
struct tbl *ap;
ap = ktenter(&homedirs, name, hash(name), NULL);
ap = ktenter(&homedirs, name, hash(name));
if (!(ap->flag & ISSET)) {
struct passwd *pw;