Skip to content

Commit ccdb9ff

Browse files
authored
perf(utils): only extract HTML once during while loop (#413)
1 parent 5d29a6b commit ccdb9ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const extract = (regex) => {
2828
let style = '';
2929
let matches;
3030

31-
while ((matches = regex.exec(getHTML())) !== null) {
31+
const html = getHTML();
32+
while ((matches = regex.exec(html)) !== null) {
3233
style += `${matches[1]} `;
3334
}
3435

0 commit comments

Comments
 (0)