]> Sergey Matveev's repositories - public-inbox.git/commitdiff
isearch: mset_to_artnums: avoid unnecessary ops
authorEric Wong <e@80x24.org>
Thu, 4 Aug 2022 08:16:59 +0000 (08:16 +0000)
committerEric Wong <e@80x24.org>
Thu, 4 Aug 2022 20:09:33 +0000 (20:09 +0000)
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

index df940e76156d0f162d179f99352e4f7091ba6cc4..2b45e08e8447b67d8234852f0f7290f84c907b26 100644 (file)
@@ -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->