Permalink
Browse files

Refactorized exec().

  • Loading branch information...
1 parent f656944 commit 5d81c16c9adef43a36086b0d4ebca8cd3207a649 @angelortega committed May 10, 2011
Showing with 3 additions and 9 deletions.
  1. +3 −9 Art5.pm
View
12 Art5.pm
@@ -250,15 +250,9 @@ sub exec {
$ret = $c->(@stream);
}
elsif (ref($c) eq 'ARRAY') {
- # push the arguments to the stack
- push(@{$self->{stack}},
- [ map { $self->exec($_); }
- @stream ]);
-
- $ret = $self->exec($c);
-
- # drop stack
- pop(@{$self->{stack}});
+ $ret = $self->exec($c,
+ map { $self->exec($_) } @stream
+ );
}
else {
croak "Artemus5 opcode not found: $op";

0 comments on commit 5d81c16

Please sign in to comment.