diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-09 11:30:43 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-09 11:30:43 -0700 |
commit | 26e53a16c4efd479a9bb89202b3e1536e76158b9 (patch) | |
tree | e730187bbf85c2cb6b80a063b7f12032d2b752e0 | |
parent | 7cd3772fe65702b6fd0574a5f435efe33c60818c (diff) | |
download | rails-26e53a16c4efd479a9bb89202b3e1536e76158b9.tar.gz rails-26e53a16c4efd479a9bb89202b3e1536e76158b9.tar.bz2 rails-26e53a16c4efd479a9bb89202b3e1536e76158b9.zip |
just use map and case / when rather than modifying the iterating array
-rw-r--r-- | actionpack/lib/action_view/path_set.rb | 13 |
1 files changed, 8 insertions, 5 deletions
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 |