Skip to content

Commit

Permalink
Use String#each_line_with_number in ini.cr
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Jan 7, 2019
1 parent 6097f44 commit caa0466
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/ini.cr
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ class INI
def self.parse(str) : Hash(String, Hash(String, String))
ini = Hash(String, Hash(String, String)).new
current_section = ini[""] = Hash(String, String).new
lineno = 0

str.each_line do |line|
lineno += 1
str.each_line_with_number do |line, lineno|
next if line.empty?

offset = 0
Expand Down

0 comments on commit caa0466

Please sign in to comment.