From 26e53a16c4efd479a9bb89202b3e1536e76158b9 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 9 Aug 2011 11:30:43 -0700 Subject: just use map and case / when rather than modifying the iterating array --- actionpack/lib/action_view/path_set.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'actionpack/lib/action_view/path_set.rb') diff --git a/actionpack/lib/action_view/path_set.rb b/actionpack/lib/action_view/path_set.rb index e9773120c7..21dc5617ad 100644 --- a/actionpack/lib/action_view/path_set.rb +++ b/actionpack/lib/action_view/path_set.rb @@ -69,13 +69,16 @@ module ActionView #:nodoc: find_all(path, prefixes, *args).any? end - protected + private def typecast(paths) - paths.each_with_index do |path, i| - path = path.to_s if path.is_a?(Pathname) - next unless path.is_a?(String) - paths[i] = OptimizedFileSystemResolver.new(path) + paths.map do |path| + case path + when Pathname, String + OptimizedFileSystemResolver.new path.to_s + else + path + end end end end -- cgit v1.2.3