Cache ItemSet#next_symbols - #28

This commit is contained in:
josh committed 2024-07-25 20:33:15 -04:00
1 parent 74d94fef72
commit 95b3dc6550
1 file changed
+1 -1
+1 -1
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.