diff --git a/lib/liquid/standardfilters.rb b/lib/liquid/standardfilters.rb index daa2c580..1864742e 100644 --- a/lib/liquid/standardfilters.rb +++ b/lib/liquid/standardfilters.rb @@ -386,7 +386,6 @@ module Liquid end elsif ary.all? { |el| el.respond_to?(:[]) } begin - property = Utils.to_s(property) ary.sort { |a, b| nil_safe_compare(a[property], b[property]) } rescue TypeError raise_property_error(property) @@ -416,7 +415,6 @@ module Liquid end elsif ary.all? { |el| el.respond_to?(:[]) } begin - property = Utils.to_s(property) ary.sort { |a, b| nil_safe_casecmp(a[property], b[property]) } rescue TypeError raise_property_error(property) @@ -504,7 +502,6 @@ module Liquid elsif ary.empty? # The next two cases assume a non-empty array. [] else - property = Utils.to_s(property) ary.uniq do |item| item[property] rescue TypeError @@ -536,11 +533,6 @@ module Liquid # @liquid_syntax array | map: string # @liquid_return [array[untyped]] def map(input, property) - property = Utils.to_s(property) - - # Return the input array if property is empty (no-op) - return InputIterator.new(input, context).to_a if property.empty? - InputIterator.new(input, context).map do |e| e = e.call if e.is_a?(Proc) @@ -570,7 +562,6 @@ module Liquid elsif ary.empty? # The next two cases assume a non-empty array. [] else - property = Liquid::Utils.to_s(property) ary.reject do |item| item[property].nil? rescue TypeError @@ -960,8 +951,6 @@ module Liquid # @liquid_syntax array | sum # @liquid_return [number] def sum(input, property = nil) - property = property.nil? ? nil : Utils.to_s(property) - ary = InputIterator.new(input, context) return 0 if ary.empty? diff --git a/lib/liquid/version.rb b/lib/liquid/version.rb index 854073d0..2eee338a 100644 --- a/lib/liquid/version.rb +++ b/lib/liquid/version.rb @@ -2,5 +2,5 @@ # frozen_string_literal: true module Liquid - VERSION = "5.8.4" + VERSION = "5.8.5" end