mirror of
https://github.com/less/less.js.git
synced 2026-01-25 15:18:03 -05:00
Merge pull request #1758 from seven-phases-max/master
Removed redundant code from tree.Selector.match()
This commit is contained in:
@@ -32,7 +32,7 @@ tree.Selector.prototype = {
|
||||
match: function (other) {
|
||||
var elements = this.elements,
|
||||
len = elements.length,
|
||||
oelements, olen, max, i;
|
||||
oelements, olen, i;
|
||||
|
||||
oelements = other.elements.map( function(v) {
|
||||
return v.combinator.value + (v.value.value || v.value);
|
||||
@@ -51,14 +51,13 @@ tree.Selector.prototype = {
|
||||
if (olen === 0 || len < olen) {
|
||||
return 0;
|
||||
} else {
|
||||
max = Math.min(len, olen);
|
||||
for (i = 0; i < max; i++) {
|
||||
for (i = 0; i < olen; i++) {
|
||||
if (elements[i].value !== oelements[i]) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return max; // return number of matched elements
|
||||
return olen; // return number of matched elements
|
||||
},
|
||||
eval: function (env) {
|
||||
var evaldCondition = this.condition && this.condition.eval(env),
|
||||
|
||||
Reference in New Issue
Block a user