summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2013-09-18 05:20:43 -0300
committerBrian Fraser <fraserbn@gmail.com>2013-09-18 05:24:43 -0300
commitd53032ed94e695c612039201d218e0c952874204 (patch)
tree97fa5b299072ec8f128eb9e9232d82b5764a0d98
parenta49b10d0a8dde2a4adb5a0a90e7b846b243e2514 (diff)
downloadperl-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index 682fe67af1..9d75cc0ffe 100644
--- a/toke.c
+++ b/toke.c
@@ -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);
}