]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ibx_async_cat: access ->{git} directly
authorEric Wong <e@80x24.org>
Tue, 23 Aug 2022 08:32:01 +0000 (08:32 +0000)
committerEric Wong <e@80x24.org>
Tue, 23 Aug 2022 22:40:57 +0000 (22:40 +0000)
This will enable callers to pass non-Inbox-ish hashrefs as the
arg.  This benefits existing Inbox-ish objects, too, as it
avoids a slow method dispatch for both ExtSearch and Inbox.

lib/PublicInbox/GitAsyncCat.pm

index 6b7425f680733ea3d5dd4aefd520354efb020444..c12c4ec2528f750043e57abf660967d34e49e147 100644 (file)
@@ -47,7 +47,7 @@ sub event_step {
 
 sub ibx_async_cat ($$$$) {
        my ($ibx, $oid, $cb, $arg) = @_;
-       my $git = $ibx->git;
+       my $git = $ibx->{git} // $ibx->git;
        # {topdir} means ExtSearch (likely [extindex "all"]) with potentially
        # 100K alternates.  git(1) has a proposed patch for 100K alternates:
        # <https://lore.kernel.org/git/20210624005806.12079-1-e@80x24.org/>