Skip to content

Commit

Permalink
Make IO::Path.child about 1.4x as fast
Browse files Browse the repository at this point in the history
By using the new `cloned-with-path' method.
  • Loading branch information
lizmat committed May 21, 2020
1 parent 71cb0c5 commit f5b2c24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.c/IO/Path.pm6
Expand Up @@ -352,8 +352,8 @@ my class IO::Path is Cool does IO {
}

method child (IO::Path:D: \child) {
nqp::create(self)!SET-SELF(
$!SPEC.join('', $!path, child.Str), $!SPEC, $!CWD, False)
nqp::clone(self).cloned-with-path:
$!SPEC.join('', $!path, child.Str)
}

method add (IO::Path:D: \what) {
Expand Down

0 comments on commit f5b2c24

Please sign in to comment.