about summary refs log tree commit homepage
path: root/lib/PublicInbox/Msgmap.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-16 19:11:33 +0000
committerEric Wong <e@80x24.org>2021-10-17 00:48:17 +0000
commit796da029ba295903d0dfb389c1576ce3985ea1af (patch)
treee1b856e743734c27ef0b11a59d4433e339d2e030 /lib/PublicInbox/Msgmap.pm
parent4fbec2e6737e9b65f0287ad1ebd14e20dfc10a93 (diff)
downloadpublic-inbox-796da029ba295903d0dfb389c1576ce3985ea1af.tar.gz
Caching the value doesn't seem necessary from a performance
perspective, and it adds a caveat for read-only users which
may lead to bugs in future code.
Diffstat (limited to 'lib/PublicInbox/Msgmap.pm')
-rw-r--r--lib/PublicInbox/Msgmap.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm
index e71f16f8..699a8bf0 100644
--- a/lib/PublicInbox/Msgmap.pm
+++ b/lib/PublicInbox/Msgmap.pm
@@ -100,13 +100,12 @@ sub created_at {
 
 sub num_highwater {
         my ($self, $num) = @_;
-        my $high = $self->{num_highwater} ||=
-            $self->meta_accessor('num_highwater');
+        my $high = $self->meta_accessor('num_highwater');
         if (defined($num) && (!defined($high) || ($num > $high))) {
-                $self->{num_highwater} = $num;
+                $high = $num;
                 $self->meta_accessor('num_highwater', $num);
         }
-        $self->{num_highwater};
+        $high
 }
 
 sub mid_insert {