inline substitution of strcmp: was called many times!
This commit is contained in:
parent
4f11f3c3fd
commit
b5083a9ccf
1 changed files with 10 additions and 4 deletions
|
@ -63,11 +63,18 @@ idf_hashed(tg, size, hc)
|
||||||
register struct idf **hook = &idf_hashtable[hc], *notch;
|
register struct idf **hook = &idf_hashtable[hc], *notch;
|
||||||
|
|
||||||
while ((notch = *hook)) {
|
while ((notch = *hook)) {
|
||||||
register cmp = strcmp(tg, notch->id_text);
|
register char *s1 = tg;
|
||||||
|
register char *cp = notch->id_text;
|
||||||
|
register int cmp;
|
||||||
|
|
||||||
|
while (!(cmp = (*s1 - *cp++))) {
|
||||||
|
if (*s1++ == '\0') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (cmp < 0)
|
if (cmp < 0)
|
||||||
break;
|
break;
|
||||||
else
|
|
||||||
if (cmp == 0) {
|
if (cmp == 0) {
|
||||||
/* suppose that special identifiers, as
|
/* suppose that special identifiers, as
|
||||||
"setjmp", are already inserted
|
"setjmp", are already inserted
|
||||||
|
@ -75,7 +82,6 @@ idf_hashed(tg, size, hc)
|
||||||
sp_occurred[notch->id_special] = 1;
|
sp_occurred[notch->id_special] = 1;
|
||||||
return notch;
|
return notch;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
hook = ¬ch->next;
|
hook = ¬ch->next;
|
||||||
}
|
}
|
||||||
/* a new struct idf must be inserted at the hook */
|
/* a new struct idf must be inserted at the hook */
|
||||||
|
|
Loading…
Add table
Reference in a new issue