From e37f8c0f0b7e429f89d53d7f31318f0941f6b735 Mon Sep 17 00:00:00 2001 From: drbrain Date: Sun, 24 Mar 2013 22:09:35 +0000 Subject: * lib/rinda/tuplespace.rb: Only return tuple entry once on move, either through port or regular return, not both. This results in a 120% speedup when combined with #8125. Patch by Joel VanderWerf. [ruby-trunk - Feature #8119] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rinda/tuplespace.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/rinda/tuplespace.rb b/lib/rinda/tuplespace.rb index ba494aa4ec..ee2bef1769 100644 --- a/lib/rinda/tuplespace.rb +++ b/lib/rinda/tuplespace.rb @@ -491,7 +491,7 @@ module Rinda port.push(entry.value) if port @bag.delete(entry) notify_event('take', entry.value) - return entry.value + return port ? nil : entry.value end raise RequestExpiredError if template.expired? @@ -506,7 +506,7 @@ module Rinda port.push(entry.value) if port @bag.delete(entry) notify_event('take', entry.value) - return entry.value + return port ? nil : entry.value end template.wait end -- cgit v1.2.3