Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match optimization #1203

Closed
wants to merge 1 commit into from
Closed

Conversation

KES777
Copy link
Contributor

@KES777 KES777 commented Mar 18, 2018

Summary

Because { captures } are localized they are will be unchanged
when ->_match returns. So we are not required to restore them

Motivation

Because $captures is a hash reference to $self->{ captures }

The code effectively do nothing, eg. $hashref = $hashref.
Maybe you mean copy by value $hashref = { %$hashref } as this is done for $self->stack:

 $self->stack([@{$snapshot[0]}])->{captures} = { %{ $snapshot[1] }};

But {captures} are localized so this copy by value is not required

References

related to this commit

Because { captures } are localized they are will be unchanged
when _match returns. So we are not required to restore them
@kraih kraih closed this in ad14e43 Mar 18, 2018
@kraih
Copy link
Member

kraih commented Mar 18, 2018

Thanks, the commit message was sadly full of typos, so i've applied the change manually.

@KES777 KES777 deleted the match_optimization branch March 18, 2018 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants