diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-06-14 22:58:50 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2018-08-14 19:53:12 +0300 |
commit | e765bff13484b3c834f0e9979550196898dc7cc9 (patch) | |
tree | 7ac0633410674dae657bfa22577b0c1b6cf82b63 /actionpack/lib/action_dispatch | |
parent | 77b0126054178cb74c2b5bb17979462095144b7c (diff) | |
download | rails-e765bff13484b3c834f0e9979550196898dc7cc9.tar.gz rails-e765bff13484b3c834f0e9979550196898dc7cc9.tar.bz2 rails-e765bff13484b3c834f0e9979550196898dc7cc9.zip |
Use `Array#extract!` where possible
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/parameter_filter.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/parameter_filter.rb b/actionpack/lib/action_dispatch/http/parameter_filter.rb index 1d58964862..de11939fa8 100644 --- a/actionpack/lib/action_dispatch/http/parameter_filter.rb +++ b/actionpack/lib/action_dispatch/http/parameter_filter.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require "active_support/core_ext/object/duplicable" +require "active_support/core_ext/array/extract" module ActionDispatch module Http @@ -38,8 +39,8 @@ module ActionDispatch end end - deep_regexps, regexps = regexps.partition { |r| r.to_s.include?("\\.".freeze) } - deep_strings, strings = strings.partition { |s| s.include?("\\.".freeze) } + deep_regexps = regexps.extract! { |r| r.to_s.include?("\\.".freeze) } + deep_strings = strings.extract! { |s| s.include?("\\.".freeze) } regexps << Regexp.new(strings.join("|".freeze), true) unless strings.empty? deep_regexps << Regexp.new(deep_strings.join("|".freeze), true) unless deep_strings.empty? |