Created
May 1, 2015 18:33
-
-
Save exodist/93efb79fc227ec799687 to your computer and use it in GitHub Desktop.
mongodb error point of problem in Test-Simple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://github.com/Test-More/test-more/blob/stream/master/lib/Test/Stream/Context.pm#L263 | |
# expanded: | |
# This still demonstrates problem: | |
sub snapshot { | |
my ($self, $type, $copy, $new); | |
$self = shift; | |
$type = blessed($self); | |
$copy = {%$self}; | |
$new = bless $copy, $type; | |
return $new; | |
} | |
# This fixes it: | |
sub snapshot { | |
my ($self, $type, $copy, $new); | |
$self = shift; | |
$type = blessed($self); | |
{ local $_; $copy = {%$self}; } | |
$new = bless $copy, $type; | |
return $new; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment