From bdbdf9c94be29c62bf425c5f2349905b5c93c162 Mon Sep 17 00:00:00 2001 From: Leeingnyo Date: Sun, 12 Sep 2021 11:09:48 +0900 Subject: [PATCH] Fix to pass 'make check', fix comments --- src/library/library.cr | 4 +++- src/library/title.cr | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/library/library.cr b/src/library/library.cr index 15674cf..4764b59 100644 --- a/src/library/library.cr +++ b/src/library/library.cr @@ -23,7 +23,9 @@ class Library Logger.debug "Load library instance" zip_file = Compress::Zip::File.new instance_file_path - instance_file = zip_file.entries.find { |entry| entry.filename == "instance.yml" } + instance_file = zip_file.entries.find do |entry| + entry.filename == "instance.yml" + end if instance_file.nil? zip_file.close diff --git a/src/library/title.cr b/src/library/title.cr index 46de5b9..ed63471 100644 --- a/src/library/title.cr +++ b/src/library/title.cr @@ -71,12 +71,12 @@ class Title end def examine(cache = {} of String => String) : Bool - return false unless Dir.exists? @dir # no title, should be removed + return false unless Dir.exists? @dir # No title, Remove this contents_signature = Dir.contents_signature @dir, cache - # not changed, preserve + # Not changed. Reuse this return true if @contents_signature == contents_signature - # fix title + # Fix title @contents_signature = contents_signature @signature = Dir.signature @dir storage = Storage.default @@ -97,8 +97,8 @@ class Title title = Library.default.get_title! title_id title.examine cache end - remained_title_dirs = @title_ids.map do |id| - title = Library.default.get_title! id + remained_title_dirs = @title_ids.map do |title_id| + title = Library.default.get_title! title_id title.dir end @@ -148,7 +148,7 @@ class Title end end - return true # this could be recycled + true # Fixed, reuse this end def to_slim_json : String