diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2016-08-03 03:52:49 +0200 |
---|---|---|
committer | Michal Nazarewicz <mina86@mina86.com> | 2016-09-09 03:07:15 +0200 |
commit | 0e7eb64076c17b3252249aa2a3ef340ce9f395bb (patch) | |
tree | 339f048596ba216d0ba15808a3121515853189b5 /lisp | |
parent | c579b28f6281c9cc0b711a012c30bf00036c60bf (diff) |
Remove dead loop iterations in regex.c
RE_CHAR_TO_MULTIBYTE(c) yields c for ASCII characters and a byte8
character for c ≥ 0x80. Furthermore, CHAR_BYTE8_P(c) is true only
for byte8 characters. This means that
c = RE_CHAR_TO_MULTIBYTE (ch);
if (! CHAR_BYTE8_P (c) && re_iswctype (c, cc))
is equivalent to:
c = c;
if (! false && re_iswctype (c, cc))
for 0 ⪬ c < 0x80, and
c = BYTE8_TO_CHAR (c);
if (! true && re_iswctype (c, cc))
for 0x80 ⪬ c < 0x100. In other words, the loop never executes for
c ≥ 0x80 and RE_CHAR_TO_MULTIBYTE call is unnecessary for c < 0x80.
* src/regex.c (regex_compile): Simplyfy a for loop by eliminating
dead iterations and unnecessary macro calls.
Diffstat (limited to 'lisp')
0 files changed, 0 insertions, 0 deletions