]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: allow ->reopen to be chainable
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Mon, 19 Mar 2018 08:14:38 +0000 (08:14 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Mon, 19 Mar 2018 08:16:34 +0000 (08:16 +0000)
Makes life a little easier for V2Writable...

lib/PublicInbox/Search.pm
lib/PublicInbox/V2Writable.pm

index 7cad31a711d5fa300ec16a030ad22288cfdb79cf..7e7c989d77faa8259089e4b0c2812a07a0116209 100644 (file)
@@ -173,6 +173,7 @@ sub reopen {
        if (my $skel = $self->{skel}) {
                $skel->reopen;
        }
+       $self; # make chaining easier
 }
 
 # read-only
index b6c46a21a704b7a1a961eaa3007ad3c5acf723c4..e673c2522db79c31104d03c389130c5fa7b321db 100644 (file)
@@ -378,8 +378,7 @@ sub lookup_content {
        my ($self, $mime, $mid) = @_;
        my $ibx = $self->{-inbox};
 
-       my $srch = $ibx->search;
-       $srch->reopen;
+       my $srch = $ibx->search->reopen;
        my $cid = content_id($mime);
        my $found;
        $srch->each_smsg_by_mid($mid, sub {