diff options
author | Eric Wong <e@80x24.org> | 2016-12-20 23:42:36 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-12-21 07:32:56 +0000 |
commit | 90b3d23352a0c37680ac266acaf4fef73a781bc9 (patch) | |
tree | 93d0a1a539f923a7045c517a882bd42995fd7567 /t | |
parent | 93474f58d361b2ace4d5e51d5be4c220513da8d0 (diff) | |
download | public-inbox-90b3d23352a0c37680ac266acaf4fef73a781bc9.tar.gz |
This simplifies callers to prevent errors and avoids needless object-orientation in favor of a single procedure call to handle threading and ordering.
Diffstat (limited to 't')
-rw-r--r-- | t/thread-cycle.t | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/t/thread-cycle.t b/t/thread-cycle.t index 9dd2aa3c..16ceee71 100644 --- a/t/thread-cycle.t +++ b/t/thread-cycle.t @@ -72,11 +72,11 @@ SKIP: { done_testing(); sub thread_to_s { - my $th = PublicInbox::SearchThread->new(shift); - $th->thread; - $th->order(sub { [ sort { $a->{id} cmp $b->{id} } @{$_[0]} ] }); + my ($msgs) = @_; + my $rootset = PublicInbox::SearchThread::thread($msgs, sub { + [ sort { $a->{id} cmp $b->{id} } @{$_[0]} ] }); my $st = ''; - my @q = map { (0, $_) } @{$th->{rootset}}; + my @q = map { (0, $_) } @$rootset; while (@q) { my $level = shift @q; my $node = shift @q or next; |