Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor performance tweak to Jaml.Node.prototype.isSelfClosing

  • Loading branch information...
commit e84e341c3ec1c0073b89711bfc5d04d574482771 1 parent c6745f2
@erikvold erikvold authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/Node.js
View
10 src/Node.js
@@ -141,13 +141,11 @@ Jaml.Node.prototype = {
* @return {Boolean} True if this tag should close itself
*/
isSelfClosing: function() {
- var selfClosing = true;
-
- for (var i = this.notSelfClosingTags.length - 1; i >= 0; i--){
- if (this.tagName == this.notSelfClosingTags[i]) selfClosing = false;
+ for (var i = this.notSelfClosingTags.length - 1; i >= 0; i--) {
+ if (this.tagName == this.notSelfClosingTags[i]) return false;
}
-
- return selfClosing;
+
+ return true;
},
/**
Please sign in to comment.
Something went wrong with that request. Please try again.