Skip to content

Commit

Permalink
Replace unused each_with_index with simple each
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Suschlik authored and asterite committed Dec 15, 2016
1 parent 2022f7e commit 5f8eb46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/string.cr
Expand Up @@ -726,7 +726,7 @@ class String
reader = Char::Reader.new(self)
i = 0

reader.each_with_index do |char|
reader.each do |char|
if i == start
start_pos = reader.pos
elsif count >= 0 && i == start + count
Expand Down Expand Up @@ -2511,7 +2511,7 @@ class String
single_byte_optimizable = ascii_only?

reader = Char::Reader.new(self)
reader.each_with_index do |char, i|
reader.each do |char|
if char == separator
piece_bytesize = reader.pos - byte_offset
piece_size = single_byte_optimizable ? piece_bytesize : 0
Expand Down

0 comments on commit 5f8eb46

Please sign in to comment.