mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Merge pull request #19069 from asgerf/js/jsdoc-parser
JS: Use StringBuilder when building up type name in JSDoc
This commit is contained in:
@@ -561,7 +561,8 @@ public class JSDocParser {
|
||||
private Token scanTypeName() {
|
||||
char ch, ch2;
|
||||
|
||||
value = new String(Character.toChars(advance()));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append((char)advance());
|
||||
while (index < endIndex && isTypeName(source.charAt(index))) {
|
||||
ch = source.charAt(index);
|
||||
if (ch == '.') {
|
||||
@@ -572,8 +573,9 @@ public class JSDocParser {
|
||||
}
|
||||
}
|
||||
}
|
||||
value += new String(Character.toChars(advance()));
|
||||
sb.append((char)advance());
|
||||
}
|
||||
value = sb.toString();
|
||||
return Token.NAME;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user