diff --git a/src/library/types.cr b/src/library/types.cr index 7856660..a0e0428 100644 --- a/src/library/types.cr +++ b/src/library/types.cr @@ -135,7 +135,7 @@ class TitleInfo end class YieldCounter - setter threshold : Int32 + @file_count : UInt32 def initialize(@threshold : Int32) @file_count = 0 @@ -143,7 +143,7 @@ class YieldCounter def count_and_yield @file_count += 1 - Fiber.yield if @file_count % @threshold == 0 + Fiber.yield if @threshold > 0 && @file_count % @threshold == 0 end end diff --git a/src/util/signature.cr b/src/util/signature.cr index 59a8311..76e2628 100644 --- a/src/util/signature.cr +++ b/src/util/signature.cr @@ -65,7 +65,7 @@ class Dir next if fn.starts_with? "." path = File.join dirname, fn if File.directory? path - signatures << Dir.contents_signature path, cache + signatures << Dir.contents_signature path, cache, counter else # Only add its signature value to `signatures` when it is a # supported file