Skip to content

Commit

Permalink
Make IO::Spec.curupdir about 25% faster
Browse files Browse the repository at this point in the history
By having it return a Block rather than a Junction.  This should make
IO::Path.dir a bit faster.
  • Loading branch information
lizmat committed May 19, 2020
1 parent 2a88990 commit 6a0eaab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core.c/IO/Spec/Unix.pm6
Expand Up @@ -60,7 +60,11 @@ my class IO::Spec::Unix is IO::Spec {
method dir-sep { '/' } # NOTE: IO::Path.resolve assumes dir sep is 1 char
method curdir { '.' }
method updir { '..' }
method curupdir { none('.','..') }
method curupdir {
-> str $dir {
nqp::hllbool(nqp::isne_s($dir,'.') && nqp::isne_s($dir,'..'))
}
}
method rootdir { '/' }
method devnull { '/dev/null' }

Expand Down

0 comments on commit 6a0eaab

Please sign in to comment.