Permalink
Browse files

minor performance tweak to Jaml.Node.prototype.isSelfClosing

  • Loading branch information...
1 parent c6745f2 commit e84e341c3ec1c0073b89711bfc5d04d574482771 @erikvold erikvold committed Jan 26, 2011
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/Node.js
View
@@ -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;
},
/**

0 comments on commit e84e341

Please sign in to comment.