This bug was hidden, and we may not be able to efficiently
implement a topmost subroutine with the hash-based (vs
linked-list) based container for threading in the next
commit.
$th->thread;
if ($q->{r}) { # order by relevance
$th->order(sub {
- [ sort { (eval { $pct{$b->topmost->{id}} } || 0)
- <=>
- (eval { $pct{$a->topmost->{id}} } || 0)
+ [ sort { ( $pct{$b->{id}} || 0) <=>
+ ( $pct{$a->{id}} || 0)
} @{$_[0]} ];
});
} else { # order by time (default for threaded view)
sub sort_ts {
[ sort {
- (eval { $a->topmost->{smsg}->ts } || 0) <=>
- (eval { $b->topmost->{smsg}->ts } || 0)
+ (eval { $a->{smsg}->ts } || 0) <=>
+ (eval { $b->{smsg}->ts } || 0)
} @{$_[0]} ];
}