X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FIMAP.pm;h=dec10d6142ba5c4ac82038d85b85cf6a32da65fb;hb=a5c21c6e800be4755848621ba223594b0bde4d95;hp=d8b1fce109ea151bdda1a6438d7d2f75219c332c;hpb=7d626338a6bf02c1098ba16302f5c13be0370673;p=public-inbox.git diff --git a/lib/PublicInbox/IMAP.pm b/lib/PublicInbox/IMAP.pm index d8b1fce1..dec10d61 100644 --- a/lib/PublicInbox/IMAP.pm +++ b/lib/PublicInbox/IMAP.pm @@ -1172,16 +1172,13 @@ sub refill_xap ($$$$) { my $srch = $self->{ibx}->search; my $opt = { mset => 2, limit => 1000 }; my $nshard = $srch->{nshard} // 1; - while (1) { - my $mset = $srch->query("$q uid:$beg..$end", $opt); - @$uids = map { mdocid($nshard, $_) } $mset->items; - if (@$uids) { - $range_info->[0] = $uids->[-1] + 1; # update $beg - return; - } else { # all done - return 0; - } + my $mset = $srch->query("$q uid:$beg..$end", $opt); + @$uids = map { mdocid($nshard, $_) } $mset->items; + if (@$uids) { + $range_info->[0] = $uids->[-1] + 1; # update $beg + return; # possibly more } + 0; # all done } sub search_xap_range { # long_response