Skip to content

Commit

Permalink
[backend] make find_linked_sources more scalable
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Jul 22, 2015
1 parent 8ccba5a commit 2bbbbe9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/backend/bs_sched
Original file line number Diff line number Diff line change
Expand Up @@ -3642,6 +3642,7 @@ sub calc_projpacks_linked {
push @projpacks_linked, @li;
}
}
print "projpacks_linked contains ".@projpacks_linked." entries\n";
#print Dumper(\@projpacks_linked);
}

Expand All @@ -3654,9 +3655,15 @@ sub find_linked_sources {
my ($projid, $packids) = @_;
my %linked;
if ($packids) {
for my $packid (unify(@$packids)) {
for my $linfo (grep {$_->{'project'} eq $projid && ($_->{'package'} eq $packid || $_->{'package'} eq ':*')} @projpacks_linked) {
push @{$linked{$linfo->{'myproject'}}}, defined($linfo->{'mypackage'}) ? $linfo->{'mypackage'} : $packid;
my %packids = map {$_ => 1} @$packids;
my @packids = sort(keys %packids);
$packids{':*'} = 1;
for my $linfo (grep {$_->{'project'} eq $projid} @projpacks_linked) {
next unless $packids{$linfo->{'package'}};
if (defined($linfo->{'mypackage'})) {
push @{$linked{$linfo->{'myproject'}}}, $linfo->{'mypackage'};
} else {
push @{$linked{$linfo->{'myproject'}}}, @packids;
}
}
} else {
Expand Down

0 comments on commit 2bbbbe9

Please sign in to comment.