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.
die "BUG: unexpected dummy mailbox: $mailbox\n";
$uid_base = $1 * UID_SLICE;
- # ->num_highwater caches for writers, so use ->meta_accessor
- $uidmax = $ibx->mm->meta_accessor('num_highwater') // 0;
+ $uidmax = $ibx->mm->num_highwater // 0;
if ($examine) {
$self->{uid_base} = $uid_base;
$self->{ibx} = $ibx;
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 {