From 14479e97ddeabab4ddadd3303087596b54a946fc Mon Sep 17 00:00:00 2001 From: Holger Just Date: Thu, 21 Sep 2017 22:26:27 +0200 Subject: [PATCH] Avoid creating additional array instance on Flows#to_ary --- lib/rackstash/flows.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rackstash/flows.rb b/lib/rackstash/flows.rb index a176a8b..d46fd26 100644 --- a/lib/rackstash/flows.rb +++ b/lib/rackstash/flows.rb @@ -134,7 +134,7 @@ module Rackstash # @return [Array] an array of all flow elements without any `nil` # values def to_ary - @flows.to_a.compact + @flows.to_a.tap(&:compact!) end alias to_a to_ary