From d1366b60b275787f282dc367e9026bb4c772f161 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 4 Aug 2022 08:16:59 +0000 Subject: [PATCH] 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. --- lib/PublicInbox/Isearch.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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-> -- 2.44.0