Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

Commit 9ce8e91

Browse files
committed
Replace to is_valid?
1 parent 8e4bb99 commit 9ce8e91

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/util/signature.cr

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class File
1919
# information as long as the above changes do not happen together with
2020
# a file/folder rename, with no library scan in between.
2121
def self.signature(filename) : UInt64
22-
if is_supported_file(filename) || is_supported_image_file(filename)
22+
if ArchiveEntry.is_valid?(filename) || is_supported_image_file(filename)
2323
File.info(filename).inode
2424
else
2525
0u64
@@ -64,13 +64,11 @@ class Dir
6464
path = File.join dirname, fn
6565
if File.directory? path
6666
signatures << Dir.contents_signature path, cache
67-
if DirEntry.is_valid? path
68-
signatures << fn
69-
end
67+
signatures << fn if DirEntry.is_valid? path
7068
else
7169
# Only add its signature value to `signatures` when it is a
7270
# supported file
73-
signatures << fn if is_supported_file fn
71+
signatures << fn if ArchiveEntry.is_valid? fn
7472
end
7573
Fiber.yield
7674
end

0 commit comments

Comments
 (0)