AGRFを1回のみ使う

This commit is contained in:
Rikuoh Tsujitani 2024-07-19 14:57:01 +09:00
parent d38889ea48
commit 3e8b029d8e

7
wc.rb
View file

@ -24,12 +24,11 @@ def count_file_stats(input)
end
def process_input(source)
input = if source == '-'
$stdin.read
if source == '-'
count_file_stats(ARGF)
else
File.read(source)
count_file_stats(File.read(source))
end
count_file_stats(input)
end
def update_totals(totals, stats)