From: Guo <99574369+Plumbiu@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:57:56 +0000 (+0800) Subject: refactor(perf): assign value in `if` block (#10836) X-Git-Tag: v3.4.27~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9c9dff805e346a88b02a9c5edb386242e49b8f1;p=thirdparty%2Fvuejs%2Fcore.git refactor(perf): assign value in `if` block (#10836) --- diff --git a/packages/shared/src/normalizeProp.ts b/packages/shared/src/normalizeProp.ts index 07e782d44f..db6e665d51 100644 --- a/packages/shared/src/normalizeProp.ts +++ b/packages/shared/src/normalizeProp.ts @@ -51,8 +51,8 @@ export function stringifyStyle( } for (const key in styles) { const value = styles[key] - const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key) if (isString(value) || typeof value === 'number') { + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key) // only render valid values ret += `${normalizedKey}:${value};` }