]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/thread-cycle.t
update copyrights for 2018
[public-inbox.git] / t / thread-cycle.t
index 9dd2aa3c64fcd6971285bb7857896172e748ede9..7d85909f1f9a534186707f3d84fe7b404fe55d15 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
@@ -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;