Profiler: Call getContentType() only once in logData()
[lhc/web/wiklou.git] / includes / profiler / ProfilerSimpleTrace.php
index 2a44494..0dd4067 100644 (file)
@@ -30,10 +30,6 @@ class ProfilerSimpleTrace extends ProfilerStandard {
        protected $trace = "Beginning trace: \n";
        protected $memory = 0;
 
-       protected function collateOnly() {
-               return true;
-       }
-
        public function profileIn( $functionname ) {
                parent::profileIn( $functionname );
 
@@ -71,13 +67,14 @@ class ProfilerSimpleTrace extends ProfilerStandard {
 
        public function logData() {
                if ( $this->mTemplated ) {
+                       $contentType = $this->getContentType();
                        if ( PHP_SAPI === 'cli' ) {
                                print "<!-- \n {$this->trace} \n -->";
-                       } elseif ( $this->getContentType() === 'text/html' ) {
+                       } elseif ( $contentType === 'text/html' ) {
                                print "<!-- \n {$this->trace} \n -->";
-                       } elseif ( $this->getContentType() === 'text/javascript' ) {
+                       } elseif ( $contentType === 'text/javascript' ) {
                                print "\n/*\n {$this->trace}\n*/";
-                       } elseif ( $this->getContentType() === 'text/css' ) {
+                       } elseif ( $contentType === 'text/css' ) {
                                print "\n/*\n {$this->trace}\n*/";
                        }
                }