Cache ItemSet#next_symbols - #28

This commit is contained in:
Josh Holtrop 2024-07-25 20:33:15 -04:00
parent 74d94fef72
commit 95b3dc6550

View File

@ -46,7 +46,7 @@ class Propane
# @return [Set<Token, RuleSet>]
# Set of next symbols for all Items in this ItemSet.
def next_symbols
Set.new(@items.map(&:next_symbol).compact)
@_next_symbols ||= Set.new(@items.map(&:next_symbol).compact)
end
# Build a next ItemSet for the given next symbol.