From 33f59aef2cd12e042600f05f587a9ca458da42f6 Mon Sep 17 00:00:00 2001 From: ashmaroli Date: Thu, 22 Mar 2018 04:40:05 +0530 Subject: [PATCH] minimize array allocations in the `where` filter (#6860) Merge pull request 6860 --- lib/jekyll/filters.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 9ec8b9e9..ddc4a054 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -174,7 +174,7 @@ module Jekyll return input unless input.respond_to?(:select) input = input.values if input.is_a?(Hash) input.select do |object| - Array(item_property(object, property)).map(&:to_s).include?(value.to_s) + Array(item_property(object, property)).map!(&:to_s).include?(value.to_s) end || [] end