about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-29 21:30:27 +0000
committerEric Wong <e@80x24.org>2015-08-29 21:35:39 +0000
commit28ee19c32a1ecf8e22f30e8f9de860695f4fb30c (patch)
tree40a372c8d3c61d7e2917d0b4c981ae61df0e0397 /lib/PublicInbox/SearchIdx.pm
parent26e69c85938c62774f20fd1861b67bcb01ba477d (diff)
downloadpublic-inbox-28ee19c32a1ecf8e22f30e8f9de860695f4fb30c.tar.gz
Perl does not currently optimize for this.

ref (from p5p):
http://mid.gmane.org/D5C27970-9176-4C7A-8B99-7D78360E67A2@pobox.com
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 292419e1..2ac53a73 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -74,7 +74,7 @@ sub add_message {
 
                 my $subj = $smsg->subject;
 
-                if (length $subj) {
+                if ($subj ne '') {
                         $doc->add_term(xpfx('subject') . $subj);
 
                         my $path = $self->subject_path($subj);
@@ -308,7 +308,7 @@ sub _index_sync {
                 my $git = PublicInbox::GitCatFile->new($self->{git_dir});
 
                 my $latest = $db->get_metadata('last_commit');
-                my $range = length $latest ? "$latest..$head" : $head;
+                my $range = $latest eq '' ? $head : "$latest..$head";
                 $latest = undef;
 
                 # get indexed messages
@@ -394,7 +394,7 @@ sub _read_git_config_perm {
 sub _git_config_perm {
         my $self = shift;
         my $perm = scalar @_ ? $_[0] : _read_git_config_perm($self);
-        return PERM_GROUP if (!defined($perm) || !length($perm));
+        return PERM_GROUP if (!defined($perm) || $perm eq '');
         return PERM_UMASK if ($perm eq 'umask');
         return PERM_GROUP if ($perm eq 'group');
         if ($perm =~ /\A(?:all|world|everybody)\z/) {