mirror of
https://github.com/less/less.js.git
synced 2026-01-23 06:07:56 -05:00
Simplify ifs
This commit is contained in:
committed by
Luke Page
parent
5cb5f561c8
commit
5444e9482b
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user