Skip to content

Commit 3dfcd20

Browse files
committed
refactor: performance improvement
1 parent 870043e commit 3dfcd20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/xmlparser/DocTypeReader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,11 @@ export default class DocTypeReader {
195195
}
196196
i++;
197197

198+
const startIndex = i;
198199
while (i < xmlData.length && xmlData[i] !== startChar) {
199-
identifierVal += xmlData[i];
200200
i++;
201201
}
202+
identifierVal = xmlData.substring(startIndex, i);
202203

203204
if (xmlData[i] !== startChar) {
204205
throw new Error(`Unterminated ${type} value`);

0 commit comments

Comments
 (0)