Skip to content

Commit b8199d3

Browse files
committed
Hoist line that is always executed out of conditional block
Saves 4 bytes.
1 parent edb2401 commit b8199d3

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/vhtml.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ export default function h(name, attrs) {
3131
s += ` ${DOMAttributeNames[i] ? DOMAttributeNames[i] : esc(i)}="${esc(attrs[i])}"`;
3232
}
3333
}
34+
s += '>';
3435

3536
if (emptyTags.indexOf(name) === -1) {
36-
s += '>';
37-
3837
if (attrs && attrs[setInnerHTMLAttr]) {
3938
s += attrs[setInnerHTMLAttr].__html;
4039
}
@@ -51,8 +50,6 @@ export default function h(name, attrs) {
5150
}
5251

5352
s += `</${name}>`;
54-
} else {
55-
s += '>';
5653
}
5754

5855
sanitized[s] = true;

0 commit comments

Comments
 (0)