Skip to content

Commit 73e6ec0

Browse files
tikksskou
andcommitted
downloader: replace with if modifier
Co-authored-by: Sutou Kouhei <[email protected]>
1 parent a0229c8 commit 73e6ec0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/datasets/downloader.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@ def initialize(url, *fallback_urls, http_method: nil, http_parameters: nil)
2020
end
2121

2222
def download(output_path, &block)
23-
if use_cache(output_path, &block)
24-
return
25-
end
23+
return if use_cache(output_path, &block)
2624

2725
partial_output_path = Pathname.new("#{output_path}.partial")
2826
synchronize(output_path, partial_output_path) do
29-
if use_cache(output_path, &block)
30-
next
31-
end
27+
next if use_cache(output_path, &block)
3228

3329
output_path.parent.mkpath
3430

0 commit comments

Comments
 (0)