# For bz_locations
use File::Basename;
-use Memoize;
@Bugzilla::Constants::EXPORT = qw(
BUGZILLA_VERSION
use constant JOB_QUEUE_VIEW_MAX_JOBS => 500;
sub bz_locations {
- # Force memoize() to re-compute data per project, to avoid
+ # Force $memoize to re-compute data per project, to avoid
# sharing the same data across different installations.
- return _bz_locations($ENV{'PROJECT'});
+ state $memoize = {};
+ my $project = $ENV{PROJECT};
+ my $key = $project // '__DEFAULT';
+
+ return $memoize->{$key} //= _bz_locations($project);
}
sub _bz_locations {
};
}
-# This makes us not re-compute all the bz_locations data every time it's
-# called.
-BEGIN { memoize('_bz_locations') };
-
1;
=head1 B<Methods in need of POD>