chore: improve set_text perf (#12823)

* chore: improve set_text perf

* chore: improve set_text perf

* chore: improve set_text perf

* chore: improve set_text perf
pull/12825/head
Dominic Gannaway 1 month ago committed by GitHub
parent c51dfcfc00
commit adcceb4aca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -47,7 +47,9 @@ export function set_text(text, value) {
if (prev !== value) {
// @ts-expect-error
text.nodeValue = text.__t = value;
text.__t = value;
// It's faster to make the value a string rather than passing a non-string to nodeValue
text.nodeValue = value == null ? '' : value + '';
}
}

Loading…
Cancel
Save