From 96b7fcf3efc2d36b370796177f7987a62f1b2fd4 Mon Sep 17 00:00:00 2001 From: Saf Date: Tue, 1 Sep 2020 00:58:53 -0700 Subject: [PATCH] Can use each_line instead of split("\n") --- lib/n65.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/n65.rb b/lib/n65.rb index 7007ed6..cb19d53 100644 --- a/lib/n65.rb +++ b/lib/n65.rb @@ -26,7 +26,7 @@ module N65 puts "Building #{infile}" unless options[:quiet] # Process each line in the file - program.split(/\n/).each_with_index do |line, line_number| + program.each_line.each_with_index do |line, line_number| begin assembler.assemble_one_line(line) rescue StandardError => e @@ -131,7 +131,7 @@ module N65 # Assemble the given string def assemble_string(string) - string.split(/\n/).each do |line| + string.each_line do |line| assemble_one_line(line) end fulfill_promises