Skip to content

Commit 798052a

Browse files
committed
refactor: See if first letter check is necessary for perf
1 parent 17fee02 commit 798052a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/diff/props.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ let eventClock = 0;
3636
*/
3737
export function setProperty(dom, name, value, oldValue, namespace) {
3838
let useCapture, prefix;
39-
if (name[0] == 'a' || name[0] == 'p') {
40-
let idx = name.indexOf(':');
41-
if (idx > -1) {
42-
// Only slices here, should be faster than array allocation
43-
prefix = name.slice(0, idx);
44-
name = name.slice(idx + 1);
45-
}
39+
let idx = name.indexOf(':');
40+
if (idx > -1) {
41+
// Only slices here, should be faster than array allocation
42+
prefix = name.slice(0, idx);
43+
name = name.slice(idx + 1);
4644
}
4745

4846
o: if (name === 'style') {

0 commit comments

Comments
 (0)