Cache ItemSet#leading_item_sets return values - #28
This commit is contained in:
parent
5f1c306273
commit
588c5e21c7
@ -99,6 +99,8 @@ class Propane
|
||||
# @return [Set<ItemSet>]
|
||||
# Set of all ItemSets that lead up to this ItemSet.
|
||||
def leading_item_sets
|
||||
@_leading_item_sets ||=
|
||||
begin
|
||||
result = Set.new
|
||||
eval_sets = Set[self]
|
||||
evaled = Set.new
|
||||
@ -115,6 +117,7 @@ class Propane
|
||||
end
|
||||
result
|
||||
end
|
||||
end
|
||||
|
||||
# Represent the ItemSet as a String.
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user