Permalink
Browse files

Simplify method chain (use 'map.with_index')

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
  • Loading branch information...
1 parent d4ba9ff commit a1f0a00b65ca9394e7a2071c6a2d6384cbe43e44 @kyrylo kyrylo committed Jan 3, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/pry/code.rb
View
@@ -134,7 +134,7 @@ def initialize(lines=[], start_line=1, code_type=:ruby)
lines = lines.lines
end
- @lines = lines.each_with_index.map { |l, i| [l.chomp, i + start_line.to_i] }
+ @lines = lines.map.with_index { |l, i| [l.chomp, i + start_line.to_i] }
@code_type = code_type
end

0 comments on commit a1f0a00

Please sign in to comment.