From 8b52a1952fa92189c6eb615178d6fa8db575e226 Mon Sep 17 00:00:00 2001 From: Ryan Christian Date: Tue, 16 Jul 2024 14:53:39 -0500 Subject: [PATCH] refactor: Apply PR suggestion Co-authored-by: Jovi De Croock --- src/diff/props.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/diff/props.js b/src/diff/props.js index 429ad643e7..ab01468fc6 100644 --- a/src/diff/props.js +++ b/src/diff/props.js @@ -36,13 +36,9 @@ let eventClock = 0; */ export function setProperty(dom, name, value, oldValue, namespace) { let useCapture, prefix; - if (name[0] == 'a' || name[0] == 'p') { - let idx = name.indexOf(':'); - if (idx > -1) { - // Only slices here, should be faster than array allocation - prefix = name.slice(0, idx); - name = name.slice(idx + 1); - } + if (name[0] == 'a' || (name[0] == 'p' && name[5] == ':')) { + prefix = name.slice(0, 4); + name = name.slice(5); } o: if (name === 'style') {