From 58e36c73193befb57d351344cea2a4a33fef850d Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Fri, 23 Sep 2016 22:02:23 +0200 Subject: Fix Style/GuardClause. --- Library/Homebrew/formula_lock.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Library/Homebrew/formula_lock.rb') diff --git a/Library/Homebrew/formula_lock.rb b/Library/Homebrew/formula_lock.rb index 8743eaef8..4bd12df18 100644 --- a/Library/Homebrew/formula_lock.rb +++ b/Library/Homebrew/formula_lock.rb @@ -10,16 +10,14 @@ class FormulaLock def lock HOMEBREW_LOCK_DIR.mkpath @lockfile = get_or_create_lockfile - unless @lockfile.flock(File::LOCK_EX | File::LOCK_NB) - raise OperationInProgressError, @name - end + return if @lockfile.flock(File::LOCK_EX | File::LOCK_NB) + raise OperationInProgressError, @name end def unlock - unless @lockfile.nil? || @lockfile.closed? - @lockfile.flock(File::LOCK_UN) - @lockfile.close - end + return if @lockfile.nil? || @lockfile.closed? + @lockfile.flock(File::LOCK_UN) + @lockfile.close end def with_lock -- cgit v1.2.3