my ($self) = @_;
my @jobs = $self->jobs->search({'me.private' => 0}, {cache => 1, prefetch => 'problem'})->all;
+ my %private;
my %hash;
for (@jobs) {
- next if !$_->problem->is_in_archive;
- $hash{$_->get_column('problem'), $_->get_column('owner')} = [$_->id, $_->result ? 0 : 1] for @jobs;
+ my $pb = $_->get_column('problem');
+ $private{$pb} //= $_->problem->is_private;
+ next if !$private{$pb};
+ $hash{$pb, $_->get_column('owner')} = [$_->id, $_->result ? 0 : 1] for @jobs;
}
my @problem_statuses = map { [split ($;), @{$hash{$_}} ] } keys %hash;