diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-09-18 22:54:40 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-18 22:54:40 -0700 |
commit | bf9a24f46471abad75fa3efba059646a6c4f5026 (patch) | |
tree | 11fb8d714b12f1cf4d067233e8e9436b2bbac415 /tokhash.pl | |
parent | 69db8c6963aab103d1cf9c2735c49bd25c28fb6b (diff) | |
download | nasm-bf9a24f46471abad75fa3efba059646a6c4f5026.tar.gz nasm-bf9a24f46471abad75fa3efba059646a6c4f5026.tar.bz2 nasm-bf9a24f46471abad75fa3efba059646a6c4f5026.zip |
Slightly optimize the interface to nasm_token_hash()
Instead of returning -1 from nasm_token_hash, set tv->t_type to
TOKEN_ID and return TOKEN_ID, since that's what stdscan.c wants to do
with it anyway. This allows us to simply tailcall nasm_token_hash().
Diffstat (limited to 'tokhash.pl')
-rwxr-xr-x | tokhash.pl | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -194,14 +194,14 @@ print " }\n"; print "\n"; printf " ix = hash1[k1 & 0x%x] + hash2[k2 & 0x%x];\n", $n-1, $n-1; printf " if (ix >= %d)\n", scalar(@tokendata); -print " return -1;\n"; +print " return tv->t_type = TOKEN_ID;\n"; print "\n"; print " data = &tokendata[ix];\n"; # print " fprintf(stderr, \"Looked for: %s found: %s\\n\", token, data->string);\n\n"; print " if (strcmp(data->string, token))\n"; -print " return -1;\n"; +print " return tv->t_type = TOKEN_ID;\n"; print "\n"; print " tv->t_integer = data->num;\n"; print " tv->t_inttwo = data->aux;\n"; |