You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code was a bit of a performance cringe. It copied every character
into a temporary array, copied that into a String, and slow-appended
that onto another String.
Note that the call to Characters.toChars is redundant here as advance()
doesn't return a code point; it returns -1 or a UTF-16 char. The -1 case
is checked for before reaching the call, so we can just cast it to
a char and use it directly.
We use a StringBuilder to accumulate the string. Normally it's faster
to track the start/end indices and do a substring(), but that won't
work in the JSDoc extractor because of the star-skipping logic in
advance().
0 commit comments