Skip to content

Commit

Permalink
Streamline Proc::Async subclass attributes
Browse files Browse the repository at this point in the history
Should save 4 scalar containers per Proc::Async object + removes
the sub BUILD
  • Loading branch information
lizmat committed Jan 26, 2020
1 parent 87bc117 commit 0c5a707
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core.c/Proc/Async.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ my class Proc::Async {
# the native descriptor of the underlying pipe.
class Pipe is Supply {
my class PermitOnTap does Tappable {
has Tappable $.delegate;
has &.on-tap;
has Tappable $.delegate is built(:bind);
has &.on-tap is built(:bind);
method tap(|c) {
&!on-tap();
$!delegate.tap(|c)
Expand All @@ -69,10 +69,8 @@ my class Proc::Async {
method sane() { self.delegate.sane }
}

has Promise $.native-descriptor;
has &!on-nd-used;

submethod BUILD(:$!native-descriptor!, :&!on-nd-used) {}
has Promise $.native-descriptor is built(:bind);
has &!on-nd-used is built(:bind);

method native-descriptor() {
&!on-nd-used();
Expand Down

0 comments on commit 0c5a707

Please sign in to comment.