From 6a3f953ded97bc16d1ec70b896fc8ed4683c8bb9 Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Wed, 15 Feb 2017 19:37:13 +0100 Subject: [PATCH] Fix number compare issues when used as map keys --- src/ast_fwd_decl.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ast_fwd_decl.hpp b/src/ast_fwd_decl.hpp index f327a9f358..c05783eda5 100644 --- a/src/ast_fwd_decl.hpp +++ b/src/ast_fwd_decl.hpp @@ -376,6 +376,11 @@ namespace Sass { struct CompareNodes { template bool operator() (const T& lhs, const T& rhs) const { + // code around sass logic issue. 1px == 1 is true + // but both items are still different keys in maps + if (dynamic_cast(lhs.ptr())) + if (dynamic_cast(rhs.ptr())) + return lhs->hash() == rhs->hash(); return !lhs.isNull() && !rhs.isNull() && *lhs == *rhs; } };