From: Eric Wong Date: Thu, 4 Aug 2022 08:16:59 +0000 (+0000) Subject: isearch: mset_to_artnums: avoid unnecessary ops X-Git-Tag: v1.9.0~51 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=d1366b60b275787f282dc367e9026bb4c772f161;p=public-inbox.git isearch: mset_to_artnums: avoid unnecessary ops We can use DBI's selectcol_arrayref directly (as we do in other places) to avoid unnecessary arrays and ops on our end. --- diff --git a/lib/PublicInbox/Isearch.pm b/lib/PublicInbox/Isearch.pm index df940e76..2b45e08e 100644 --- a/lib/PublicInbox/Isearch.pm +++ b/lib/PublicInbox/Isearch.pm @@ -69,12 +69,11 @@ sub mset_to_artnums { $range = 'AND xnum >= ? AND xnum <= ?'; @r = @$r; } - my $rows = $self->{es}->over->dbh-> - selectall_arrayref(<<"", undef, $ibx_id, @$docids, @r); + return $self->{es}->over->dbh-> + selectcol_arrayref(<<"", undef, $ibx_id, @$docids, @r); SELECT xnum FROM xref3 WHERE ibx_id = ? AND docid IN ($qmarks) $range ORDER BY xnum ASC - return [ map { $_->[0] } @$rows ]; } my $rows = $self->{es}->over->dbh->