commit 9b4d794ae6c685b822c9318d2f343ca5e5814ffc
parent e74b4c840eed17236373664d1fcf773a434e5f6b
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 10 Jul 2014 15:01:01 +0200
Small changes in symbol.c
Revert change to lookup to improve readibility.
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/cc1/symbol.c b/cc1/symbol.c
@@ -73,9 +73,11 @@ context(Symbol *lbreak, Symbol *lcont, Caselist *lswitch)
Symbol *
lookup(register char *s, uint8_t ns)
{
+ struct symtab *tbl;
register Symbol *sym;
- for (sym = symtab[ns].htab[hash(s)]; sym; sym = sym->hash) {
+ tbl = &symtab[ns];
+ for (sym = tbl->htab[hash(s)]; sym; sym = sym->hash) {
if (!strcmp(sym->name, s))
return sym;
}
@@ -99,10 +101,7 @@ install(char *s, uint8_t ns)
sym->next = tbl->head;
tbl->head = sym;
-
t = &tbl->htab[hash(s)];
sym->hash = *t;
- *t = sym;
-
- return sym;
+ return *t = sym;
}