Simplify VisitTracker::getVisitTime()
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 26 Apr 2022 12:30:33 +0000 (14:30 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 26 Apr 2022 12:30:33 +0000 (14:30 +0200)
wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php

index 2fbeee68bd2311b830194d64144ea2a1992d51cc..3fd3cea547769c7acda0437ac673a3915e29fdd6 100644 (file)
@@ -111,12 +111,7 @@ class VisitTracker extends SingletonFactory
             $minimum = \max($minimum, WCF::getUser()->registrationDate);
         }
 
-        if (isset($this->userVisits[$objectTypeID])) {
-            // using `max()` here will yield the most recent point in time
-            return \max($this->userVisits[$objectTypeID], $minimum);
-        }
-
-        return $minimum;
+        return \max($this->userVisits[$objectTypeID] ?? 0, $minimum);
     }
 
     /**