Skip to content

Commit

Permalink
One identity sub shall suffice
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Aug 9, 2018
1 parent db96cab commit 09f5d0b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/vm/moar/spesh-plugins.nqp
Expand Up @@ -49,11 +49,12 @@ nqp::speshreg('perl6', 'maybemeth', -> $obj, str $name {
# Often we have nothing at all to do, in which case we can make it a no-op.
# Other times, we need a decont. In a few, we need to re-wrap it.

sub identity($obj) { $obj }

{
# We look up Iterable when the plugin is used.
my $Iterable := nqp::null();

sub identity($obj) { $obj }
sub mu($replaced) { Mu }
sub decont($obj) { nqp::decont($obj) }
sub recont($obj) {
Expand Down Expand Up @@ -154,8 +155,6 @@ nqp::speshreg('perl6', 'maybemeth', -> $obj, str $name {
}
}

sub identity($obj) { $obj }

sub make-unchecked-coercion($rv, $coerce_to) {
# We already have the type fixed, so we can resolve to the coercion
# method if available.
Expand Down

0 comments on commit 09f5d0b

Please sign in to comment.