From 2e89591e8ada1cbc267a58c963a6a7c196b768c6 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Fri, 18 Aug 2023 04:37:43 -0400 Subject: [PATCH] golf size/perf of #4096 (#4102) * golf size/perf of #4096 * golf * golf 2 --- src/diff/props.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/diff/props.js b/src/diff/props.js index 68f7624bf9..db2f1f821d 100644 --- a/src/diff/props.js +++ b/src/diff/props.js @@ -83,11 +83,7 @@ export function setProperty(dom, name, value, oldValue, isSvg) { } // Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6 else if (name[0] === 'o' && name[1] === 'n') { - if (/PointerCapture$/.test(name)) { - useCapture = false; - } else { - useCapture = name !== (name = name.replace(/Capture$/, '')); - } + useCapture = name !== (name = name.replace(/(PointerCapture)$|Capture$/, '$1')); // Infer correct casing for DOM built-in events: if (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);