Skip to content

Commit 7ebcbe8

Browse files
committed
parse_ident: Use variable to avoid expression duplication
And make it clearer
1 parent bd66bdc commit 7ebcbe8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

toke.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10599,12 +10599,13 @@ S_parse_ident(pTHX_ const char *s, const char * const s_end,
1059910599
}
1060010600

1060110601
/* Here we have found the end of the identifier */
10602-
if (*d + (t - s) > e)
10602+
Size_t this_length = t - s;
10603+
if (*d + this_length > e)
1060310604
croak("%s", ident_too_long);
1060410605

1060510606
/* And copy the whole thing in one operation */
10606-
Copy(s, *d, t - s, char);
10607-
*d += t - s;
10607+
Copy(s, *d, this_length, char);
10608+
*d += this_length;
1060810609
s = t;
1060910610
}
1061010611
else if ( isWORDCHAR_A(*s) ) {

0 commit comments

Comments
 (0)