minimize array allocations in the `where` filter (#6860)

Merge pull request 6860
This commit is contained in:
ashmaroli 2018-03-22 04:40:05 +05:30 committed by jekyllbot
parent 7d759f0ff0
commit 33f59aef2c
1 changed files with 1 additions and 1 deletions

View File

@ -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