]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1302755 - Optimize request_cache() more
authorDylan William Hardison <dylan@hardison.net>
Wed, 14 Sep 2016 15:36:13 +0000 (11:36 -0400)
committerDylan William Hardison <dylan@hardison.net>
Mon, 19 Sep 2016 15:25:16 +0000 (11:25 -0400)
r=jfearn

Bugzilla.pm
Bugzilla/Install/Util.pm

index 4c983bd1fd745f639e8279af089bfca794d67a24..a8917aab8090a9454739a25ee254d9c977ce21dd 100644 (file)
@@ -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
index f85378b4719fed048d905935f51a7417cdd33a9b..fe5776175d5934f0484d468fd23ef7a049dbac2b 100644 (file)
@@ -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 #