This will make it easier to cache this.

Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com>
---
 sg-report-job-history | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sg-report-job-history b/sg-report-job-history
index 8932458e..118926c6 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -173,11 +173,11 @@ END
     while (my $f= $flightsq->fetchrow_hashref()) {
         my $ri= report_run_getinfo($f);
 
-       $ri->{Hosts} = [ ];
+       $ri->{Hosts} = { };
        foreach my $hostvar (@hostvarcols) {
            $hostq->execute($f->{flight}, $f->{job}, $hostvar);
            my ($host) = $hostq->fetchrow_array();
-           push @{ $ri->{Hosts} }, ($host // "-");
+           $ri->{Hosts}{$hostvar} = $host;
        }
 
         my %revisions;
@@ -255,7 +255,7 @@ END
        print H "<td $r->{ColourAttr}><a href=\"$url\">".
            $r->{Content}."</a></td>\n";
        my $lastrev;
-       my $hosts = join ", ", map { $_ // "-" } @{ $r->{Hosts} };
+       my $hosts = join ", ", map { $r->{Hosts}{$_} // "-" } @hostvarcols;
        my $hosts_colour = report_altchangecolour(\$alt_hosts, $hosts);
        print H "<td $hosts_colour>".encode_entities($hosts)."</td>\n";
        $osstestverq->execute($r->{Flight}{flight});
-- 
2.11.0


Reply via email to