diff options
author | Brian Fraser <fraserbn@gmail.com> | 2013-09-18 05:20:43 -0300 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2013-09-18 05:24:43 -0300 |
commit | d53032ed94e695c612039201d218e0c952874204 (patch) | |
tree | 97fa5b299072ec8f128eb9e9232d82b5764a0d98 | |
parent | a49b10d0a8dde2a4adb5a0a90e7b846b243e2514 (diff) | |
download | perl-d53032ed94e695c612039201d218e0c952874204.tar.gz |
toke.c, scan_ident: No need for a while loop when using PEEKSPACE
PEEKSPACE already gobbles up all the remaining spaces until it
either finds a non-space character, or EOF.
-rw-r--r-- | toke.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -9418,7 +9418,7 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni) bracket = s; s++; orig_copline = CopLINE(PL_curcop); - while (s < PL_bufend && isSPACE(*s)) { + if (s < PL_bufend && isSPACE(*s)) { s = PEEKSPACE(s); } } @@ -9478,7 +9478,7 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni) parse_ident(&s, &d, e, 1, is_utf8); *d = '\0'; tmp_copline = CopLINE(PL_curcop); - while (s < PL_bufend && isSPACE(*s)) { + if (s < PL_bufend && isSPACE(*s)) { s = PEEKSPACE(s); } if ((*s == '[' || (*s == '{' && strNE(dest, "sub")))) { @@ -9517,7 +9517,7 @@ S_scan_ident(pTHX_ char *s, char *dest, STRLEN destlen, I32 ck_uni) if ( !tmp_copline ) tmp_copline = CopLINE(PL_curcop); - while (s < PL_bufend && isSPACE(*s)) { + if (s < PL_bufend && isSPACE(*s)) { s = PEEKSPACE(s); } |