diff --git a/ChangeLog b/ChangeLog index 2da62025fe..d7abe538cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 30 01:17:51 2007 Masatoshi SEKI + + * lib/rinda/tuplespace.rb (TupleSpace#create_entry, TupleBag#push, + delete): extract method, and rename parameter. + Fri Apr 27 02:00:17 2007 Ryan Davis * signal.c: Fixed backwards compatibility for 'raise Interrupt'. diff --git a/lib/rinda/tuplespace.rb b/lib/rinda/tuplespace.rb index 73e79bb401..cb86b47221 100644 --- a/lib/rinda/tuplespace.rb +++ b/lib/rinda/tuplespace.rb @@ -304,20 +304,20 @@ module Rinda end ## - # Add +ary+ to the TupleBag. + # Add +tuple+ to the TupleBag. - def push(ary) - size = ary.size + def push(tuple) + size = tuple.size @hash[size] ||= [] - @hash[size].push(ary) + @hash[size].push(tuple) end ## - # Removes +ary+ from the TupleBag. + # Removes +tuple+ from the TupleBag. - def delete(ary) - size = ary.size - @hash.fetch(size, []).delete(ary) + def delete(tuple) + size = tuple.size + @hash.fetch(size, []).delete(tuple) end ## @@ -403,7 +403,7 @@ module Rinda # Adds +tuple+ def write(tuple, sec=nil) - entry = TupleEntry.new(tuple, sec) + entry = create_entry(tuple, sec) start_keeper synchronize do if entry.expired? @@ -529,6 +529,10 @@ module Rinda private + def create_entry(tuple, sec) + TupleEntry.new(tuple, sec) + end + ## # Removes dead tuples.