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.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 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 627131F46D for ; Sun, 22 Dec 2019 22:17:41 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/4] searchidx: call "++" on PostingIterator instead of "->inc" Date: Sun, 22 Dec 2019 22:17:38 +0000 Message-Id: <20191222221740.17114-3-e@80x24.org> In-Reply-To: <20191222221740.17114-1-e@80x24.org> References: <20191222221740.17114-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: The "++" is not yet available in the SWIG-based "Xapian.pm" Perl bindings, so use "++" where it's supported in both the XS (Search::Xapian) and SWIG-based Xapian binding. --- lib/PublicInbox/SearchIdx.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 926fac80..b56fd0ee 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -384,7 +384,7 @@ sub batch_do { my ($head, $tail) = $self->find_doc_ids($termval); return if $head == $tail; my @ids; - for (; $head != $tail && @ids < $batch_size; $head->inc) { + for (; $head != $tail && @ids < $batch_size; $head++) { push @ids, $head->get_docid; } $cb->(\@ids); @@ -439,7 +439,7 @@ sub remove_by_oid { # there is only ONE element in @delete unless we # have bugs in our v2writable deduplication check my @delete; - for (; $head != $tail; $head->inc) { + for (; $head != $tail; $head++) { my $docid = $head->get_docid; my $doc = $db->get_document($docid); my $smsg = PublicInbox::SearchMsg->wrap($mid);