Skip to content

Commit

Permalink
[io grant] Make IO::Path.is-absolute about 80% faster
Browse files Browse the repository at this point in the history
Benched with IO::Spec::Unix spec
  • Loading branch information
zoffixznet committed Apr 20, 2017
1 parent 277b6e5 commit 74680d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/IO/Path.pm
Expand Up @@ -57,7 +57,10 @@ my class IO::Path is Cool does IO {
}

method is-absolute() {
$!is-absolute //= so $!SPEC.is-absolute($!path);
nqp::if(
nqp::isconcrete($!is-absolute),
$!is-absolute,
$!is-absolute = nqp::p6bool($!SPEC.is-absolute: $!path))
}
method is-relative() {
!( $!is-absolute //= so $!SPEC.is-absolute($!path) );
Expand Down

0 comments on commit 74680d4

Please sign in to comment.