Skip to content

Commit c5f5a1f

Browse files
committed
revert to prev version
1 parent 0bf16a7 commit c5f5a1f

4 files changed

Lines changed: 29 additions & 29 deletions

File tree

src/libsass/src/ast.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ namespace Sass {
348348

349349
bool Complex_Selector::operator== (const Selector& rhs) const
350350
{
351-
if (const Selector_List* sl = Cast<Selector_List>(&rhs)) return this->eq(*sl);
352-
if (const Simple_Selector* sp = Cast<Simple_Selector>(&rhs)) return this->eq(*sp);
353-
if (const Complex_Selector* cs = Cast<Complex_Selector>(&rhs)) return this->eq(*cs);
354-
if (const Compound_Selector* ch = Cast<Compound_Selector>(&rhs)) return this->eq(*ch);
351+
if (const Selector_List* sl = Cast<Selector_List>(&rhs)) return *this == *sl;
352+
if (const Simple_Selector* sp = Cast<Simple_Selector>(&rhs)) return *this == *sp;
353+
if (const Complex_Selector* cs = Cast<Complex_Selector>(&rhs)) return *this == *cs;
354+
if (const Compound_Selector* ch = Cast<Compound_Selector>(&rhs)) return *this == *ch;
355355
throw std::runtime_error("invalid selector base classes to compare");
356356
}
357357

@@ -367,10 +367,10 @@ namespace Sass {
367367

368368
bool Compound_Selector::operator== (const Selector& rhs) const
369369
{
370-
if (const Selector_List* sl = Cast<Selector_List>(&rhs)) return this->eq(*sl);
371-
if (const Simple_Selector* sp = Cast<Simple_Selector>(&rhs)) return this->eq(*sp);
372-
if (const Complex_Selector* cs = Cast<Complex_Selector>(&rhs)) return this->eq(*cs);
373-
if (const Compound_Selector* ch = Cast<Compound_Selector>(&rhs)) return this->eq(*ch);
370+
if (const Selector_List* sl = Cast<Selector_List>(&rhs)) return *this == *sl;
371+
if (const Simple_Selector* sp = Cast<Simple_Selector>(&rhs)) return *this == *sp;
372+
if (const Complex_Selector* cs = Cast<Complex_Selector>(&rhs)) return *this == *cs;
373+
if (const Compound_Selector* ch = Cast<Compound_Selector>(&rhs)) return *this == *ch;
374374
throw std::runtime_error("invalid selector base classes to compare");
375375
}
376376

@@ -440,9 +440,9 @@ namespace Sass {
440440
bool Selector_List::operator== (const Selector& rhs) const
441441
{
442442
// solve the double dispatch problem by using RTTI information via dynamic cast
443-
if (Selector_List_Ptr_Const sl = Cast<Selector_List>(&rhs)) { return this->eq(*sl); }
444-
else if (Complex_Selector_Ptr_Const cpx = Cast<Complex_Selector>(&rhs)) { return this->eq(*cpx); }
445-
else if (Compound_Selector_Ptr_Const cpd = Cast<Compound_Selector>(&rhs)) { return this->eq(*cpd); }
443+
if (Selector_List_Ptr_Const sl = Cast<Selector_List>(&rhs)) { return *this == *sl; }
444+
else if (Complex_Selector_Ptr_Const cpx = Cast<Complex_Selector>(&rhs)) { return *this == *cpx; }
445+
else if (Compound_Selector_Ptr_Const cpd = Cast<Compound_Selector>(&rhs)) { return *this == *cpd; }
446446
// no compare method
447447
return this == &rhs;
448448
}
@@ -451,8 +451,8 @@ namespace Sass {
451451
bool Selector_List::operator== (const Expression& rhs) const
452452
{
453453
// solve the double dispatch problem by using RTTI information via dynamic cast
454-
if (List_Ptr_Const ls = Cast<List>(&rhs)) { return ls->eq(*this); }
455-
if (Selector_Ptr_Const ls = Cast<Selector>(&rhs)) { return this->eq(*ls); }
454+
if (List_Ptr_Const ls = Cast<List>(&rhs)) { return *ls == *this; }
455+
if (Selector_Ptr_Const ls = Cast<Selector>(&rhs)) { return *this == *ls; }
456456
// compare invalid (maybe we should error?)
457457
return false;
458458
}
@@ -691,7 +691,7 @@ namespace Sass {
691691
return (name() == rhs.name())
692692
&& (matcher() == rhs.matcher())
693693
&& (is_ns_eq(rhs))
694-
&& (value()->eq(*rhs.value()));
694+
&& (*value() == *rhs.value());
695695
}
696696
// not equal
697697
return false;
@@ -750,7 +750,7 @@ namespace Sass {
750750
{
751751
String_Obj lhs_ex = expression();
752752
String_Obj rhs_ex = rhs.expression();
753-
if (rhs_ex && lhs_ex) return lhs_ex->eq(*rhs_ex);
753+
if (rhs_ex && lhs_ex) return *lhs_ex == *rhs_ex;
754754
else return lhs_ex.ptr() == rhs_ex.ptr();
755755
}
756756
else return false;
@@ -1957,7 +1957,7 @@ namespace Sass {
19571957
Expression_Obj rv = (*r)[i];
19581958
Expression_Obj lv = (*this)[i];
19591959
if (!lv || !rv) return false;
1960-
if (!(lv->eq(*rv))) return false;
1960+
if (!(*lv == *rv)) return false;
19611961
}
19621962
return true;
19631963
}
@@ -1993,7 +1993,7 @@ namespace Sass {
19931993
Expression_Obj rv = r->at(i);
19941994
Expression_Obj lv = this->at(i);
19951995
if (!lv || !rv) return false;
1996-
if (!(lv->eq(*rv))) return false;
1996+
if (!(*lv == *rv)) return false;
19971997
}
19981998
return true;
19991999
}
@@ -2008,7 +2008,7 @@ namespace Sass {
20082008
Expression_Obj lv = at(key);
20092009
Expression_Obj rv = r->at(key);
20102010
if (!rv || !lv) return false;
2011-
if (!(lv->eq(*rv))) return false;
2011+
if (!(*lv == *rv)) return false;
20122012
}
20132013
return true;
20142014
}
@@ -2223,4 +2223,4 @@ namespace Sass {
22232223
IMPLEMENT_AST_OPERATORS(Placeholder_Selector);
22242224
IMPLEMENT_AST_OPERATORS(Definition);
22252225
IMPLEMENT_AST_OPERATORS(Declaration);
2226-
}
2226+
}

src/libsass/src/ast.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ namespace Sass {
15051505
if (!(m && name() == m->name())) return false;
15061506
if (!(m && arguments()->length() == m->arguments()->length())) return false;
15071507
for (size_t i =0, L = arguments()->length(); i < L; ++i)
1508-
if (!((*arguments())[i]->eq(*(*m->arguments())[i]))) return false;
1508+
if (!(*(*arguments())[i] == *(*m->arguments())[i])) return false;
15091509
return true;
15101510
}
15111511
catch (std::bad_cast&)

src/libsass/src/cssize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ namespace Sass {
459459
if (!parent ||
460460
parent->statement_type() != Statement::MEDIA ||
461461
node->node()->statement_type() != Statement::MEDIA ||
462-
(m1 && m2 && m1->media_queries()->eq(*m2->media_queries()))
462+
(m1 && m2 && *m1->media_queries() == *m2->media_queries())
463463
)
464464
{
465465
ss = node->node();

src/libsass/src/eval.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ namespace Sass {
597597
else if (Color_Ptr r_c = Cast<Color>(rhs)) {
598598
try {
599599
switch (op_type) {
600-
case Sass_OP::EQ: return l_n->eq(*r_c) ? bool_true : bool_false;
601-
case Sass_OP::NEQ: return l_n->eq(*r_c) ? bool_false : bool_true;
600+
case Sass_OP::EQ: return *l_n == *r_c ? bool_true : bool_false;
601+
case Sass_OP::NEQ: return *l_n == *r_c ? bool_false : bool_true;
602602
case Sass_OP::ADD: case Sass_OP::SUB: case Sass_OP::MUL: case Sass_OP::DIV: case Sass_OP::MOD:
603603
return Operators::op_number_color(op_type, *l_n, *r_c, ctx.c_options, b_in->pstate());
604604
default: break;
@@ -616,12 +616,12 @@ namespace Sass {
616616
if (Color_Ptr r_c = Cast<Color>(rhs)) {
617617
try {
618618
switch (op_type) {
619-
case Sass_OP::EQ: return l_c->eq(*r_c) ? bool_true : bool_false;
620-
case Sass_OP::NEQ: return l_c->eq(*r_c) ? bool_false : bool_true;
619+
case Sass_OP::EQ: return *l_c == *r_c ? bool_true : bool_false;
620+
case Sass_OP::NEQ: return *l_c == *r_c ? bool_false : bool_true;
621621
case Sass_OP::LT: return *l_c < *r_c ? bool_true : bool_false;
622622
case Sass_OP::GTE: return *l_c < *r_c ? bool_false : bool_true;
623-
case Sass_OP::LTE: return *l_c < *r_c || l_c->eq(*r_c) ? bool_true : bool_false;
624-
case Sass_OP::GT: return *l_c < *r_c || l_c->eq(*r_c) ? bool_false : bool_true;
623+
case Sass_OP::LTE: return *l_c < *r_c || *l_c == *r_c ? bool_true : bool_false;
624+
case Sass_OP::GT: return *l_c < *r_c || *l_c == *r_c ? bool_false : bool_true;
625625
case Sass_OP::ADD: case Sass_OP::SUB: case Sass_OP::MUL: case Sass_OP::DIV: case Sass_OP::MOD:
626626
return Operators::op_colors(op_type, *l_c, *r_c, ctx.c_options, b_in->pstate());
627627
default: break;
@@ -637,8 +637,8 @@ namespace Sass {
637637
else if (Number_Ptr r_n = Cast<Number>(rhs)) {
638638
try {
639639
switch (op_type) {
640-
case Sass_OP::EQ: return l_c->eq(*r_n) ? bool_true : bool_false;
641-
case Sass_OP::NEQ: return l_c->eq(*r_n) ? bool_false : bool_true;
640+
case Sass_OP::EQ: return *l_c == *r_n ? bool_true : bool_false;
641+
case Sass_OP::NEQ: return *l_c == *r_n ? bool_false : bool_true;
642642
case Sass_OP::ADD: case Sass_OP::SUB: case Sass_OP::MUL: case Sass_OP::DIV: case Sass_OP::MOD:
643643
return Operators::op_color_number(op_type, *l_c, *r_n, ctx.c_options, b_in->pstate());
644644
default: break;

0 commit comments

Comments
 (0)