From 20b8fcd726483823d8fe3c8ed3a37bdc74406fcd Mon Sep 17 00:00:00 2001
From: Jonathan Chang <me@jonathanchang.org>
Date: Mon, 9 Nov 2020 20:15:28 +1100
Subject: [PATCH] rubocop: fix Style/CollectionCompact

---
 Library/Homebrew/system_command.rb | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb
index 5a762fe313..3d83ec5c0a 100644
--- a/Library/Homebrew/system_command.rb
+++ b/Library/Homebrew/system_command.rb
@@ -100,12 +100,11 @@ class SystemCommand
   end
 
   def env_args
-    set_variables = env.reject { |_, value| value.nil? }
-                       .map do |name, value|
-                         sanitized_name = Shellwords.escape(name)
-                         sanitized_value = Shellwords.escape(value)
-                         "#{sanitized_name}=#{sanitized_value}"
-                       end
+    set_variables = env.compact.map do |name, value|
+      sanitized_name = Shellwords.escape(name)
+      sanitized_value = Shellwords.escape(value)
+      "#{sanitized_name}=#{sanitized_value}"
+    end
 
     return [] if set_variables.empty?
 
-- 
GitLab