Profiler: Call getContentType() only once in logData()
[lhc/web/wiklou.git] / includes / profiler / ProfilerSimpleTrace.php
index 95e4bc6..0dd4067 100644 (file)
@@ -67,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*/";
                        }
                }