Skip to content

Commit 2be0c3d

Browse files
committed
Fixes massive performance issue when using eql?
Not sure if it's due to constructing the array and calling #hash on it or what, but the previous implementation is terrible on performance refs: zmoazeni#42, zmoazeni#32
1 parent a443956 commit 2be0c3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/csscss/types.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def without_parents
3030

3131
def ==(other)
3232
if other.respond_to?(:property) && other.respond_to?(:value)
33-
eql?(other)
33+
# using eql? tanks performance
34+
property == other.property && normalize_value(value) == normalize_value(other.value)
3435
else
3536
false
3637
end

0 commit comments

Comments
 (0)