diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-04-03 11:09:11 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-04-03 12:06:15 +0000 |
commit | 445d2062a60959a04b55d7d1fe4439eff23cd44d (patch) | |
tree | 653eea288da968a04561224bc1ba079ed644ded3 /lib/PublicInbox/Mbox.pm | |
parent | 0dceebd0a85774c92af247e6da5e2f5a0ee8417c (diff) | |
download | public-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.pm | 11 |
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); |