Skip to content

Commit

Permalink
RakuAST: reuse expectations list
Browse files Browse the repository at this point in the history
instead of creating a new one every time.  Should help a bit in
memory churn.
  • Loading branch information
lizmat committed Aug 31, 2023
1 parent 056bf03 commit 3ed02c3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Raku/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ my role stop[$stop] {
token stopper { $stop }
}

#-------------------------------------------------------------------------------
# Functionality common to all Raku grammars

role Raku::Common {

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -68,7 +71,7 @@ role Raku::Common {

# Reset expectations
method reset-expectations() {
self.'!set_highexpect'(nqp::list_s)
nqp::setelems(self.'!highexpect'(),0)
}

#-------------------------------------------------------------------------------
Expand Down

0 comments on commit 3ed02c3

Please sign in to comment.