From 1f2f392b42c5e1e10488d2034a0686c7e8768ad4 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Mon, 11 Apr 2016 10:39:02 -0400 Subject: [PATCH] LP 1768715: Simplify Open-ILS/src/support-scripts/pingest.pl with selectcol_arrayref. By switching to DBI->selectcol_arrayref in pingest.pl, we can avoid having to check for references in the main loop. This eliminates an extra variable and an extra line of code that are no longer needed. Signed-off-by: Jason Stephenson Signed-off-by: Bill Erickson --- Open-ILS/src/support-scripts/pingest.pl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/support-scripts/pingest.pl b/Open-ILS/src/support-scripts/pingest.pl index 9c9252857b..8389c5328c 100755 --- a/Open-ILS/src/support-scripts/pingest.pl +++ b/Open-ILS/src/support-scripts/pingest.pl @@ -152,12 +152,11 @@ if ($opt_pipe) { } } else { my $dbh = DBI->connect('DBI:Pg:'); - @input = @{$dbh->selectall_arrayref($q)}; + @input = @{$dbh->selectcol_arrayref($q)}; $dbh->disconnect(); } -foreach my $r (@input) { - my $record = (ref($r)) ? $r->[0] : $r; +foreach my $record (@input) { push(@blist, $record); # separate list of browse-only ingest push(@$records, $record); if (++$count == $batch_size) { -- 2.43.2