diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2013-07-16 01:33:09 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2013-07-16 01:33:09 +0400 |
commit | 836492fbcf074a609434e8cf6ce7580fc6b319bc (patch) | |
tree | 3f9ce6e43a3f7223f656fda608feaa4977f403bc /parser.c | |
parent | 525ef263592fa7c6dc8edad66cce283b11a06ee7 (diff) | |
download | nasm-836492fbcf074a609434e8cf6ce7580fc6b319bc.tar.gz nasm-836492fbcf074a609434e8cf6ce7580fc6b319bc.tar.bz2 nasm-836492fbcf074a609434e8cf6ce7580fc6b319bc.zip |
parse_line: Shrink code with memset helper
We know that P_none = 0 thus instead of using
for() statement assign them all in one memset
call.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -201,7 +201,6 @@ insn *parse_line(int pass, char *buffer, insn *result, ldfunc ldef) int critical; bool first; bool recover; - int j; restart_parse: first = true; @@ -261,8 +260,8 @@ restart_parse: return result; } - for (j = 0; j < MAXPREFIX; j++) - result->prefixes[j] = P_none; + nasm_build_assert(P_none != 0); + memset(result->prefixes, P_none, sizeof(result->prefixes)); result->times = 1L; while (i == TOKEN_PREFIX || |