about summary refs log tree commit homepage
path: root/lib/PublicInbox/Mbox.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-03 11:09:11 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-03 12:06:15 +0000
commit445d2062a60959a04b55d7d1fe4439eff23cd44d (patch)
tree653eea288da968a04561224bc1ba079ed644ded3 /lib/PublicInbox/Mbox.pm
parent0dceebd0a85774c92af247e6da5e2f5a0ee8417c (diff)
downloadpublic-inbox-445d2062a60959a04b55d7d1fe4439eff23cd44d.tar.gz
id_batch had a an overly complicated interface, replace it
with id_batch which is simpler and takes advantage of
selectcol_arrayref in DBI.  This allows simplification of
callers and the diffstat agrees with me.
Diffstat (limited to 'lib/PublicInbox/Mbox.pm')
-rw-r--r--lib/PublicInbox/Mbox.pm11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index 0be19685..c66ccaa7 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -166,14 +166,7 @@ sub mbox_all {
         return sub { need_gzip(@_) } if $@;
         if ($query eq '') {
                 my $prev = 0;
-                my $msgs = [];
-                my $cb = sub {
-                        $ctx->{-inbox}->mm->id_batch($prev, sub {
-                                $msgs = $_[0];
-                        });
-                        $prev = $msgs->[-1] if @$msgs;
-                        $msgs;
-                };
+                my $cb = sub { $ctx->{-inbox}->mm->ids_after(\$prev) };
                 return PublicInbox::MboxGz->response($ctx, $cb, 'all');
         }
         my $opts = { offset => 0 };
@@ -244,7 +237,7 @@ sub getline {
         do {
                 # work on existing result set
                 while (defined(my $smsg = shift @$msgs)) {
-                        # id_batch may return integers
+                        # ids_after may return integers
                         ref($smsg) or
                                 $smsg = $ctx->{srch}->{over_ro}->get_art($smsg);