Skip to content

Instantly share code, notes, and snippets.

@skids
Last active October 8, 2015 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skids/7be38321eade492c3fd9 to your computer and use it in GitHub Desktop.
Save skids/7be38321eade492c3fd9 to your computer and use it in GitHub Desktop.
I think there might be a sliver of performance gain on that test script
with the following, but it is hard to tell. Oddly, it generates smaller
QAST but larger MAST.
diff --git a/src/core/Array.pm b/src/core/Array.pm
index e4960b0..2e03127 100644
--- a/src/core/Array.pm
+++ b/src/core/Array.pm
@@ -319,7 +319,7 @@ my class Array { # declared in BOOTSTRAP
method is-lazy() {
my $todo := nqp::getattr(self, List, '$!todo');
- if $todo.DEFINITE {
+ $todo.DEFINITE and {
$todo.reify-until-lazy();
if $todo.fully-reified {
nqp::bindattr(self, List, '$!todo', Mu);
@@ -328,10 +328,7 @@ my class Array { # declared in BOOTSTRAP
else {
True;
}
- }
- else {
- False
- }
+ }()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment