]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiViewText.pm
get rid of unnecessary bytes::length usage
[public-inbox.git] / lib / PublicInbox / LeiViewText.pm
index e0d62c0d2ab7de7e1ac53466b42e37d4bd21ff9e..340a66481225fbcc0a25867a95ff83933de06435 100644 (file)
@@ -7,7 +7,6 @@ package PublicInbox::LeiViewText;
 use strict;
 use v5.10.1;
 use PublicInbox::MsgIter qw(msg_part_text);
-use PublicInbox::ContentHash qw(git_sha);
 use PublicInbox::MID qw(references);
 use PublicInbox::View;
 use PublicInbox::Hval;
@@ -69,7 +68,7 @@ sub uncolored { ${$_[0]->{obuf}} .= $_[2] }
 sub new {
        my ($cls, $lei) = @_;
        my $self = bless { %{$lei->{opt}}, -colored => \&uncolored }, $cls;
-       return $self unless $self->{color} || -t $lei->{1};
+       return $self unless $self->{color} //= -t $lei->{1};
        my $cmd = [ qw(git config -z --includes -l) ];
        my ($r, $pid) = popen_rd($cmd, undef, { 2 => $lei->{2} });
        my $cfg = PublicInbox::Config::config_fh_parse($r, "\0", "\n");