summaryrefslogtreecommitdiff
path: root/stdscan.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-18 22:54:40 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-18 22:54:40 -0700
commitbf9a24f46471abad75fa3efba059646a6c4f5026 (patch)
tree11fb8d714b12f1cf4d067233e8e9436b2bbac415 /stdscan.c
parent69db8c6963aab103d1cf9c2735c49bd25c28fb6b (diff)
downloadnasm-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 'stdscan.c')
-rw-r--r--stdscan.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/stdscan.c b/stdscan.c
index b6a4ee8..aecbd4a 100644
--- a/stdscan.c
+++ b/stdscan.c
@@ -75,7 +75,6 @@ int stdscan(void *private_data, struct tokenval *tv)
(*stdscan_bufptr == '$' && isidstart(stdscan_bufptr[1]))) {
/* now we've got an identifier */
int is_sym = FALSE;
- int t;
if (*stdscan_bufptr == '$') {
is_sym = TRUE;
@@ -99,10 +98,7 @@ int stdscan(void *private_data, struct tokenval *tv)
*r = '\0';
/* right, so we have an identifier sitting in temp storage. now,
* is it actually a register or instruction name, or what? */
- if ((t = nasm_token_hash(ourcopy, tv)) != -1)
- return t;
- else
- return tv->t_type = TOKEN_ID;
+ return nasm_token_hash(ourcopy, tv);
} else if (*stdscan_bufptr == '$' && !isnumchar(stdscan_bufptr[1])) {
/*
* It's a $ sign with no following hex number; this must