From b623210d6725d246e0096f0b903c089b8be4fa2e Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Tue, 1 Nov 2016 12:44:18 +0100 Subject: [PATCH] No need for intermediary now we have LEAVE Also, we don't need a block for LEAVE either. --- src/core/Lock.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/Lock.pm b/src/core/Lock.pm index a00c1fafcbe..ef153ec3302 100644 --- a/src/core/Lock.pm +++ b/src/core/Lock.pm @@ -20,9 +20,8 @@ my class Lock { method protect(Lock:D: &code) { nqp::lock(self); - my \res := code(); - LEAVE { nqp::unlock(self); } - res + LEAVE nqp::unlock(self); + code() } method condition(Lock:D:) {