Skip to content

Commit

Permalink
Make IO::Path.succ/pred about 1.6x 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 26b9f38 commit 7238b09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/core.c/IO/Path.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@ my class IO::Path is Cool does IO {
}

method cleanup (IO::Path:D:) {
nqp::create(self)!SET-SELF(
$!SPEC.canonpath($!path), $!SPEC, $!CWD, False)
nqp::clone(self).cloned-with-path($!SPEC.canonpath($!path))
}
method resolve (IO::Path:D: :$completely) {
# XXXX: Not portable yet; assumes POSIX semantics
Expand Down

1 comment on commit 7238b09

@lizmat
Copy link
Contributor Author

@lizmat lizmat commented on 7238b09 May 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, this is about IO::Path.cleanup

Please sign in to comment.