diff options
author | Eric Wong <e@80x24.org> | 2021-09-26 01:42:29 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-26 01:43:35 +0000 |
commit | 70a3ec18d29c7fde9a5c06fe019b8bedef7acec8 (patch) | |
tree | 4363d6fbee709f540947390f306dbebd3adf345e /lib/PublicInbox/Inbox.pm | |
parent | b87b0181f30fa58954af25cd79bce652f4b0cddb (diff) | |
download | public-inbox-70a3ec18d29c7fde9a5c06fe019b8bedef7acec8.tar.gz |
This saves us some memory for the hash slot in the common case the `cloneurl' file doesn't exist.
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r-- | lib/PublicInbox/Inbox.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 3ba92c99..1d5fc708 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -216,11 +216,11 @@ sub description { sub cloneurl { my ($self) = @_; - ($self->{cloneurl} //= do { + $self->{cloneurl} // do { my $s = try_cat("$self->{inboxdir}/cloneurl"); my @urls = split(/\s+/s, $s); - scalar(@urls) ? \@urls : undef - }) // []; + scalar(@urls) ? ($self->{cloneurl} = \@urls) : undef; + } // []; } sub base_url { |