Skip to content

Commit

Permalink
Fix hash
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Sep 29, 2023
1 parent f073652 commit b6dd4dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions lib/sass/value/function.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ module Value
class Function
include Value

# @overload initialize(id)
# @param id [Numeric]
# @overload initialize(signature, callback)
# @param signature [::String]
# @param callback [Proc]
Expand Down Expand Up @@ -42,7 +40,7 @@ def ==(other)

# @return [Integer]
def hash
id.nil? ? signature.hash : id.hash
@hash ||= id.nil? ? signature.hash : id.hash
end

# @return [Function]
Expand Down
10 changes: 5 additions & 5 deletions lib/sass/value/fuzzy_math.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ def assert_between(number, min, max, name)
end

def hash(number)
@hash ||= if number.finite?
(number * INVERSE_EPSILON).round.hash
else
number.hash
end
if number.finite?
(number * INVERSE_EPSILON).round.hash
else
number.hash
end
end
end

Expand Down

0 comments on commit b6dd4dc

Please sign in to comment.