diff --git a/lib/sass/value/function.rb b/lib/sass/value/function.rb index 3d412c92..cad01b35 100644 --- a/lib/sass/value/function.rb +++ b/lib/sass/value/function.rb @@ -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] @@ -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] diff --git a/lib/sass/value/fuzzy_math.rb b/lib/sass/value/fuzzy_math.rb index c3aa6e2a..5fc6bc63 100644 --- a/lib/sass/value/fuzzy_math.rb +++ b/lib/sass/value/fuzzy_math.rb @@ -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