Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/private/legacy/OC_App.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static function cleanAppId(string $app): string {
* @return bool
*/
public static function isAppLoaded(string $app): bool {
return in_array($app, self::$loadedApps, true);
return isset(self::$loadedApps[$app]);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a lot faster that the in_array search

}

/**
Expand Down Expand Up @@ -127,7 +127,7 @@ public static function loadApps(array $types = []): bool {
// prevent app.php from printing output
ob_start();
foreach ($apps as $app) {
if (($types === [] or self::isType($app, $types)) && !in_array($app, self::$loadedApps)) {
if (!isset(self::$loadedApps[$app]) && ($types === [] || self::isType($app, $types))) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the order here since the quick array check is just much much faster

self::loadApp($app);
}
}
Expand All @@ -143,7 +143,7 @@ public static function loadApps(array $types = []): bool {
* @throws Exception
*/
public static function loadApp(string $app) {
self::$loadedApps[] = $app;
self::$loadedApps[$app] = true;
$appPath = self::getAppPath($app);
if ($appPath === false) {
return;
Expand Down