From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8C0051F619 for ; Thu, 4 Aug 2022 08:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1659601024; bh=jOU/9panF11dvO4T8VuBTNnJ/6cNywEyZpOSE8LW874=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kuGi8j/IJEs6nDtPv/G+BYfXhN2cfTqe14/+oDIVaaAZMho/fbmYScVn7haceL1l0 DF/5FCDv8d8QaaFFJ0bpLAf6DiV8hgrFd9qPm9Lz2aFoGyoL3uFbcLaVrLegosx4Pe Qeo7ZTl1IKl4RWm7YNDu3bJJS6d6kEJPrbdynl2I= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/7] isearch: mset_to_artnums: avoid unnecessary ops Date: Thu, 4 Aug 2022 08:16:59 +0000 Message-Id: <20220804081703.1410595-4-e@80x24.org> In-Reply-To: <20220804081703.1410595-1-e@80x24.org> References: <20220804081703.1410595-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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->