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 end
def process_input(source) def process_input(source)
input = if source == '-' if source == '-'
$stdin.read count_file_stats(ARGF)
else else
File.read(source) count_file_stats(File.read(source))
end end
count_file_stats(input)
end end
def update_totals(totals, stats) def update_totals(totals, stats)