From a2fb2b00fd6bd5e81b0e9b03b7591144c8f72116 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Tue, 16 May 2023 00:34:32 -0400 Subject: [PATCH] GithubRelease: Simplify block handling The `#versions_from_content` method requires a regex and this will be enforced by the type signature, so we don't have to check for the presence of a regex when handling a `strategy` block. --- Library/Homebrew/livecheck/strategy/github_release.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Library/Homebrew/livecheck/strategy/github_release.rb b/Library/Homebrew/livecheck/strategy/github_release.rb index cbd5a9a8a9..dcf09194c1 100644 --- a/Library/Homebrew/livecheck/strategy/github_release.rb +++ b/Library/Homebrew/livecheck/strategy/github_release.rb @@ -100,11 +100,7 @@ module Homebrew } def self.versions_from_content(content, regex, &block) if block.present? - block_return_value = if regex.present? - yield(content, regex) - else - yield(content) - end + block_return_value = yield(content, regex) return Strategy.handle_block_return(block_return_value) end