From 5444e9482b96dc15cf6bd73eab418e2eb0c0dba2 Mon Sep 17 00:00:00 2001 From: Kim Joar Bekkelund Date: Mon, 6 May 2013 12:52:01 +0200 Subject: [PATCH] Simplify ifs --- lib/less/parser.js | 6 +----- lib/less/tree/rule.js | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index 4977aafd..1fca4673 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -223,11 +223,7 @@ less.Parser = function Parser(env) { if (typeof(tok) === 'string') { return input.charAt(i) === tok; } else { - if (tok.test(chunks[j])) { - return true; - } else { - return false; - } + return tok.test(chunks[j]); } } diff --git a/lib/less/tree/rule.js b/lib/less/tree/rule.js index f0ef9930..5fab422d 100644 --- a/lib/less/tree/rule.js +++ b/lib/less/tree/rule.js @@ -8,10 +8,7 @@ tree.Rule = function (name, value, important, merge, index, currentFileInfo, inl this.index = index; this.currentFileInfo = currentFileInfo; this.inline = inline || false; - - if (name.charAt(0) === '@') { - this.variable = true; - } else { this.variable = false } + this.variable = (name.charAt(0) === '@'); }; tree.Rule.prototype = {