From: Dylan William Hardison Date: Wed, 14 Sep 2016 15:36:13 +0000 (-0400) Subject: Bug 1302755 - Optimize request_cache() more X-Git-Tag: release-5.1.2~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6477ccf87c1b77e01dbc3aec8af1d19249b6ca54;p=thirdparty%2Fbugzilla.git Bug 1302755 - Optimize request_cache() more r=jfearn --- diff --git a/Bugzilla.pm b/Bugzilla.pm index 4c983bd1fd..a8917aab80 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -651,12 +651,10 @@ sub local_timezone { ||= DateTime::TimeZone->new(name => 'local'); } -my $request_cache = Bugzilla::Install::Util::_cache(); - -sub request_cache { return $request_cache } +use constant request_cache => Bugzilla::Install::Util::_cache(); sub clear_request_cache { - %$request_cache = (); + %{ request_cache() } = (); } # This is a per-process cache. Under mod_cgi it's identical to the diff --git a/Bugzilla/Install/Util.pm b/Bugzilla/Install/Util.pm index f85378b471..fe5776175d 100644 --- a/Bugzilla/Install/Util.pm +++ b/Bugzilla/Install/Util.pm @@ -657,8 +657,7 @@ sub prevent_windows_dialog_boxes { # This is like request_cache, but it's used only by installation code # for checksetup.pl and things like that. -my $_cache = {}; -sub _cache { return $_cache; } +use constant _cache => {}; ############################### # Copied from Bugzilla::Util #