Skip to content

Commit

Permalink
Hoist line that is always executed out of conditional block
Browse files Browse the repository at this point in the history
Saves 4 bytes.
  • Loading branch information
pl12133 committed Sep 4, 2017
1 parent edb2401 commit b8199d3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/vhtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ export default function h(name, attrs) {
s += ` ${DOMAttributeNames[i] ? DOMAttributeNames[i] : esc(i)}="${esc(attrs[i])}"`;
}
}
s += '>';

if (emptyTags.indexOf(name) === -1) {
s += '>';

if (attrs && attrs[setInnerHTMLAttr]) {
s += attrs[setInnerHTMLAttr].__html;
}
Expand All @@ -51,8 +50,6 @@ export default function h(name, attrs) {
}

s += `</${name}>`;
} else {
s += '>';
}

sanitized[s] = true;
Expand Down

0 comments on commit b8199d3

Please sign in to comment.