Skip to content

Commit 3d7ef5a

Browse files
committed
perf: for loop directives
1 parent 924cfca commit 3d7ef5a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

index.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ function postHTMLParser(html, options) {
2828
var directives = options.directives || defaultDirectives;
2929

3030
for (var i = 0; i < directives.length; i++) {
31-
if (name.toLowerCase() === directives[i].name) {
32-
results.push(
33-
directives[i].start +
34-
data +
35-
directives[i].end
36-
);
31+
var directive = directives[i];
32+
33+
if (name.toLowerCase() === directive.name) {
34+
results.push(directive.start + data + directive.end);
3735
}
3836
}
3937
}

0 commit comments

Comments
 (0)