about summary refs log tree commit homepage
path: root/lib/PublicInbox/InboxWritable.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/InboxWritable.pm')
-rw-r--r--lib/PublicInbox/InboxWritable.pm30
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/PublicInbox/InboxWritable.pm b/lib/PublicInbox/InboxWritable.pm
index 9eab394d..c73910ac 100644
--- a/lib/PublicInbox/InboxWritable.pm
+++ b/lib/PublicInbox/InboxWritable.pm
@@ -52,22 +52,20 @@ sub init_inbox {
 
 sub importer {
         my ($self, $parallel) = @_;
-        $self->{-importer} ||= do {
-                my $v = $self->{version} || 1;
-                if ($v == 2) {
-                        eval { require PublicInbox::V2Writable };
-                        die "v2 not supported: $@\n" if $@;
-                        my $opt = $self->{-creat_opt};
-                        my $v2w = PublicInbox::V2Writable->new($self, $opt);
-                        $v2w->{parallel} = $parallel;
-                        $v2w;
-                } elsif ($v == 1) {
-                        my @arg = (undef, undef, undef, $self);
-                        PublicInbox::Import->new(@arg);
-                } else {
-                        $! = 78; # EX_CONFIG 5.3.5 local configuration error
-                        die "unsupported inbox version: $v\n";
-                }
+        my $v = $self->{version} || 1;
+        if ($v == 2) {
+                eval { require PublicInbox::V2Writable };
+                die "v2 not supported: $@\n" if $@;
+                my $opt = $self->{-creat_opt};
+                my $v2w = PublicInbox::V2Writable->new($self, $opt);
+                $v2w->{parallel} = $parallel;
+                $v2w;
+        } elsif ($v == 1) {
+                my @arg = (undef, undef, undef, $self);
+                PublicInbox::Import->new(@arg);
+        } else {
+                $! = 78; # EX_CONFIG 5.3.5 local configuration error
+                die "unsupported inbox version: $v\n";
         }
 }