]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei convert: inline convert_start
authorEric Wong <e@80x24.org>
Mon, 22 Feb 2021 11:22:58 +0000 (08:22 -0300)
committerEric Wong <e@80x24.org>
Mon, 22 Feb 2021 22:14:22 +0000 (18:14 -0400)
Since we stopped using LeiAuth as a WQ worker, keeping this
around as a single-use sub makes no sense and wastes several
KB of memory.

lib/PublicInbox/LeiConvert.pm

index b45de4e0fe0d227e0e3c9a51c2836aa5912f9ced..4839dea498c89d3d18e7e09a1aa1cfd5add589de 100644 (file)
@@ -62,17 +62,6 @@ sub do_convert { # via wq_do
        delete $self->{wcb}; # commit
 }
 
-sub convert_start {
-       my ($lei) = @_;
-       my $self = $lei->{cnv};
-       my $op = $lei->workers_start($self, 'lei_convert', 1, {
-               '' => [ $lei->can('dclose'), $lei ]
-       });
-       $self->wq_io_do('do_convert', []);
-       $self->wq_close(1);
-       while ($op && $op->{sock}) { $op->event_step }
-}
-
 sub call { # the main "lei convert" method
        my ($cls, $lei, @inputs) = @_;
        my $opt = $lei->{opt};
@@ -131,7 +120,12 @@ sub call { # the main "lei convert" method
                $nrd->{quiet} = $opt->{quiet};
                $lei->{nrd} = $nrd;
        }
-       convert_start($lei);
+       my $op = $lei->workers_start($self, 'lei_convert', 1, {
+               '' => [ $lei->can('dclose'), $lei ]
+       });
+       $self->wq_io_do('do_convert', []);
+       $self->wq_close(1);
+       while ($op && $op->{sock}) { $op->event_step }
 }
 
 sub ipc_atfork_child {