diff options
| author | Paul Buetow <paul@buetow.org> | 2023-03-19 17:43:15 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-03-19 17:43:15 +0200 |
| commit | 928804fa23e5ec1d8a445a7284c6fbce00f86072 (patch) | |
| tree | 0c8dcd3389c52efbd1fcbc5f01ff7dde869be23e | |
| parent | 1948769754cb1453dc4693b2595045110b44f17b (diff) | |
only aggregate once
| -rw-r--r-- | guprecords.raku | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/guprecords.raku b/guprecords.raku index 5b53aa0..c0cb22e 100644 --- a/guprecords.raku +++ b/guprecords.raku @@ -162,9 +162,12 @@ class HostReporter is Reporter { } sub do-it(Str:D \stats-dir, Reporter:D \reporter) { - my Aggregator \aggregator .= new; - aggregator.add-file($_) for dir(stats-dir, test => { /.records$/ }); - reporter.aggregates = aggregator.aggregates; + state Aggregator $aggregator = do { + my Aggregator \aggregator .= new; + aggregator.add-file($_) for dir(stats-dir, test => { /.records$/ }); + aggregator; + }; + reporter.aggregates = $aggregator.aggregates; reporter.report; } |
