Skip to content

Instantly share code, notes, and snippets.

@peschwa
Created January 26, 2015 12:16
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 peschwa/a74aba56552314223ea0 to your computer and use it in GitHub Desktop.
Save peschwa/a74aba56552314223ea0 to your computer and use it in GitHub Desktop.
diff --git a/src/core/Cursor.pm b/src/core/Cursor.pm
index cd5d206..d17eb30 100644
--- a/src/core/Cursor.pm
+++ b/src/core/Cursor.pm
@@ -39,11 +39,14 @@ my class Cursor does NQPCursorRole {
if nqp::iterval($curcap) >= 2 {
#?endif
my str $name = nqp::iterkey_s($curcap);
- nqp::iscclass(nqp::const::CCLASS_NUMERIC, $name, 0)
- ?? nqp::bindpos(
- nqp::if(nqp::isconcrete($list), $list, ($list := nqp::list())),
- nqp::bind(my int $, $name), [])
- !! nqp::bindkey($hash, $name, []);
+ if nqp::iscclass(nqp::const::CCLASS_NUMERIC, $name, 0) {
+ nqp::bindpos(
+ nqp::if(nqp::isconcrete($list), $list, ($list := nqp::list())),
+ nqp::bind(my int $, $name), [])
+ }
+ elsif $name ne '' {
+ nqp::bindkey($hash, $name, []);
+ }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment