From b57ee5cf5ba312b6e5f5df9208be8e2b02e13242 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 10 Apr 2024 08:46:39 -0400 Subject: [PATCH] Fix `Style/MapIntoArray` cop in context helper (#29885) --- app/helpers/context_helper.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/helpers/context_helper.rb b/app/helpers/context_helper.rb index 2d7a4f98fd..cbefe0fe53 100644 --- a/app/helpers/context_helper.rb +++ b/app/helpers/context_helper.rb @@ -48,13 +48,11 @@ module ContextHelper end def serialized_context(named_contexts_map, context_extensions_map) - context_array = [] - named_contexts = named_contexts_map.keys context_extensions = context_extensions_map.keys - named_contexts.each do |key| - context_array << NAMED_CONTEXT_MAP[key] + context_array = named_contexts.map do |key| + NAMED_CONTEXT_MAP[key] end extensions = context_extensions.each_with_object({}) do |key, h|