From a2612e23dcbed7592893c470cbd5019708c81290 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger <697964+dduugg@users.noreply.github.com> Date: Sun, 3 Nov 2024 08:58:14 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Kevin --- Library/Homebrew/cask/cask.rb | 2 +- Library/Homebrew/cleanup.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index 901853d03a9cb..08ac1b3340d0c 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -174,7 +174,7 @@ def uninstall_flight_blocks? def install_time # /.metadata///Casks/.{rb,json} -> caskfile = installed_caskfile - caskfile ? Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) : nil + Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) if caskfile end sig { returns(T.nilable(Pathname)) } diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index e94a8c2e317c2..00ca1e00d049b 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -154,7 +154,7 @@ def stale_formula?(pathname, scrub) stable = formula.stable if resource_name == "patch" - patch_hashes = stable&.patches&.filter_map { _1.resource.version if _1.external } + patch_hashes = stable&.patches&.filter_map { _1.resource.version if _1.external? } return true unless patch_hashes&.include?(Checksum.new(version.to_s)) elsif resource_name && stable && (resource_version = stable.resources[resource_name]&.version) return true if resource_version != version