KES777 / mojo

Mojolicious - Perl real-time web framework
http://mojolicio.us
Artistic License 2.0
0 stars 0 forks source link

Match optimization #28

Closed KES777 closed 6 years ago

KES777 commented 6 years ago

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

KES777 commented 6 years ago

merged at upstream