diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-01-21 16:31:57 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-01-21 16:31:57 -0800 |
commit | b4daadc0d8e7eb9f431ad78b4b9925d0d94eed57 (patch) | |
tree | 899809e737e63661579523c7a39b220691fb435a | |
parent | 216d074e9774b3010ba06f1fe1fa8f1175c42cdf (diff) | |
download | nasm-b4daadc0d8e7eb9f431ad78b4b9925d0d94eed57.tar.gz |
preproc.c: simplify detoken() slightly
Probably pointless optimization of detoken()...
-rw-r--r-- | preproc.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -987,6 +987,7 @@ static char *detoken(Token * tlist, int expand_locals) Token *t; int len; char *line, *p; + const char *q; len = 0; for (t = tlist; t; t = t->next) { @@ -1023,12 +1024,11 @@ static char *detoken(Token * tlist, int expand_locals) p = line = nasm_malloc(len + 1); for (t = tlist; t; t = t->next) { if (t->type == TOK_WHITESPACE) { - *p = ' '; - p++; - *p = '\0'; + *p++ = ' '; } else if (t->text) { - strcpy(p, t->text); - p += strlen(p); + q = t->text; + while (*q) + *p++ = *q++; } } *p = '\0'; |