Closed KES777 closed 6 years ago
Because { captures } are localized they are will be unchanged when ->_match returns. So we are not required to restore them
{ captures }
->_match
Because $captures is a hash reference to $self->{ captures }
$captures
$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:
$hashref = $hashref
$hashref = { %$hashref }
$self->stack
$self->stack([@{$snapshot[0]}])->{captures} = { %{ $snapshot[1] }};
But {captures} are localized so this copy by value is not required
{captures}
related to this commit
merged at upstream
Summary
Because
{ captures }
are localized they are will be unchanged when->_match
returns. So we are not required to restore themMotivation
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
:But
{captures}
are localized so this copy by value is not requiredReferences
related to this commit