Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use nqp::iter* ops on JVM instead of parrot methods to iterate hashes

  • Loading branch information...
commit d6221ad88378525f7707f6f7e343dd3d84024889 1 parent 8839c5b
@sorear sorear authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/core/EnumMap.pm
View
10 src/core/EnumMap.pm
@@ -58,7 +58,12 @@ my class EnumMap does Associative {
my Mu $pair;
while $iter {
$pair := nqp::shift($iter);
+#?if jvm
+ take Pair.new(:key(nqp::p6box_s(nqp::iterkey_s($pair))), :value(nqp::iterval($pair)));
+#?endif
+#?if parrot
take Pair.new(:key($pair.key), :value($pair.value));
+#?endif
}
Nil
}
@@ -69,7 +74,12 @@ my class EnumMap does Associative {
my Mu $pair;
while $iter {
$pair := nqp::shift($iter);
+#?if jvm
+ take Pair.new(:key(nqp::iterval($pair)), :value(nqp::p6box_s(nqp::iterkey_s($pair))));
+#?endif
+#?if parrot
take Pair.new(:key($pair.value), :value($pair.key));
+#?endif
}
Nil
}

0 comments on commit d6221ad

Please sign in to comment.
Something went wrong with that request. Please try again.