Tinebase_Core::getLogLevel
authorPaul Mehrer <p.mehrer@metaways.de>
Sun, 22 Dec 2013 18:44:20 +0000 (19:44 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 23 Dec 2013 10:34:39 +0000 (11:34 +0100)
self::get was called twice without sense. Now its being called only once. This can be up to 150 calls for Addressbook.searchContacts for example, easily an other 5ms.

Change-Id: Id6d8f4af77a3c2f48d57bc4841be639b8c08e73d
Reviewed-on: https://gerrit.tine20.org/tine20/2680
Tested-by: jenkins user
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/Core.php

index f789bbd..47230e6 100644 (file)
@@ -1388,12 +1388,12 @@ class Tinebase_Core
      */
     public static function getLogLevel()
     {
-        if (! self::get(self::LOGLEVEL)) {
+        if (! ($logLevel = self::get(self::LOGLEVEL))) {
             $config = self::getConfig();
             $logLevel = Tinebase_Log::getMaxLogLevel(isset($config->logger) ? $config->logger : NULL);
             self::set(self::LOGLEVEL, $logLevel);
         }
-        return self::get(self::LOGLEVEL);
+        return $logLevel;
     }
     
     /**