Skip to content

Commit 6a3f953

Browse files
committed
Fix number compare issues when used as map keys
1 parent d5b6fe7 commit 6a3f953

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ast_fwd_decl.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@ namespace Sass {
376376
struct CompareNodes {
377377
template <class T>
378378
bool operator() (const T& lhs, const T& rhs) const {
379+
// code around sass logic issue. 1px == 1 is true
380+
// but both items are still different keys in maps
381+
if (dynamic_cast<Number*>(lhs.ptr()))
382+
if (dynamic_cast<Number*>(rhs.ptr()))
383+
return lhs->hash() == rhs->hash();
379384
return !lhs.isNull() && !rhs.isNull() && *lhs == *rhs;
380385
}
381386
};

0 commit comments

Comments
 (0)