From 8f5c76542fe6e0b78095c3a748fd10dd01a714ef Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 24 Jun 2016 23:40:01 +0000 Subject: inbox: do not weaken already-weak refs This quiets a (hopefully harmless) warning when a ref remains alive through several expiry timeouts. --- lib/PublicInbox/Inbox.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/Inbox.pm') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 3f1b7334..34191fc7 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -5,7 +5,7 @@ package PublicInbox::Inbox; use strict; use warnings; -use Scalar::Util qw(weaken); +use Scalar::Util qw(weaken isweak); use PublicInbox::Git; use PublicInbox::MID qw(mid2path); @@ -19,7 +19,9 @@ sub new { sub weaken_all { my ($self) = @_; - weaken($self->{$_}) foreach qw(git mm search); + foreach my $f (qw(git mm search)) { + isweak($self->{$f}) or weaken($self->{$f}); + } } sub git { -- cgit v1.2.3-24-ge0c7