]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/IdxStack.pm
idx_stack: avoid conditional hash assignment weirdness
[public-inbox.git] / lib / PublicInbox / IdxStack.pm
index d51230061ae504323e5a3e2e2128222c6a0d41d6..54d480bdd3710fe8ffa2418c665313d609688d27 100644 (file)
@@ -20,12 +20,12 @@ sub new {
 sub push_rec {
        my ($self, $file_char, $at, $ct, $blob_oid, $cmt_oid) = @_;
        my $rec = pack(PACK_FMT, $file_char, $at, $ct, $blob_oid, $cmt_oid);
-       $self->{unpack_fmt} //= do {
+       $self->{unpack_fmt} // do {
                my $len = length($cmt_oid);
                my $fmt = PACK_FMT;
                $fmt =~ s/H\*/H$len/g;
                $self->{rec_size} = length($rec);
-               $fmt;
+               $self->{unpack_fmt} = $fmt;
        };
        print { $self->{wr} } $rec or die "print: $!";
        $self->{tot_size} += length($rec);