Skip to content

Commit

Permalink
just use map and case / when rather than modifying the iterating array
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 9, 2011
1 parent 7cd3772 commit 26e53a1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions actionpack/lib/action_view/path_set.rb
Expand Up @@ -69,13 +69,16 @@ def exists?(path, prefixes, *args)
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
Expand Down

0 comments on commit 26e53a1

Please sign in to comment.