Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test can be false even if we want to test
  • Loading branch information
lizmat committed Nov 4, 2014
1 parent 2b6e9e7 commit 49874e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/IO.pm
Expand Up @@ -304,7 +304,7 @@ sub MAKE-DIR-LIST(Str $abspath, Mu $test) {
my Mu $dirh := nqp::opendir(nqp::unbox_s($abspath));
nqp::chdir($cwd);

if $test {
if $test.defined {
gather { loop {
my str $elem_s = nqp::nextfiledir($dirh);
if nqp::isnull_s($elem_s) || nqp::chars($elem_s) == 0 {
Expand Down Expand Up @@ -340,7 +340,7 @@ sub MAKE-DIR-LIST(Str $abspath, Mu $test) {

my Mu $dirh := nqp::opendir(nqp::unbox_s($abspath.chop));
gather {
if $test {
if $test.defined {
for <. ..> -> $elem {
take $abspath ~ $elem if $test.ACCEPTS($elem);
}
Expand Down Expand Up @@ -379,7 +379,7 @@ sub MAKE-DIR-LIST(Str $abspath, Mu $test) {
my Mu $RSA := pir::new__PS('OS').readdir(nqp::unbox_s($abspath));
my int $elems = nqp::elems($RSA);

if $test {
if $test.defined {
gather loop (my int $i = 0; $i < $elems; $i = $i + 1) {
my Str $elem = nqp::p6box_s(pir::trans_encoding__Ssi(
nqp::atpos_s($RSA, $i),
Expand Down

0 comments on commit 49874e1

Please sign in to comment.