diff options
| author | 2025-01-10 08:13:09 +0100 | |
|---|---|---|
| committer | 2025-01-10 08:13:09 +0100 | |
| commit | 5368f38753a3e655ed3d7d7dfc7af2cc22de7980 (patch) | |
| tree | decb975aa750660cea965bf61399df2335493b9d /app/Controllers/feedController.php | |
| parent | 3280ec617f8081bf0d5349e441ae564a42fdc500 (diff) | |
Reduce undeeded use of elvis operator ?: (#7204)
Diffstat (limited to 'app/Controllers/feedController.php')
| -rwxr-xr-x | app/Controllers/feedController.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index cc321aa49..4d64b40b5 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -337,7 +337,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { FreshRSS_View::prependTitle(_t('sub.feed.title_add') . ' ยท '); $catDAO = FreshRSS_Factory::createCategoryDao(); - $this->view->categories = $catDAO->listCategories(false) ?: []; + $this->view->categories = $catDAO->listCategories(prePopulateFeeds: false); $this->view->feed = new FreshRSS_Feed($url); try { // We try to get more information about the feed. @@ -423,12 +423,8 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { } } else { $feeds = $feedDAO->listFeedsOrderUpdate(-1); - // Hydrate category for each feed to avoid that each feed has to make an SQL request - $categories = []; - foreach ($catDAO->listCategories(false, false) as $category) { - $categories[$category->id()] = $category; - } + $categories = $catDAO->listCategories(prePopulateFeeds: false, details: false); foreach ($feeds as $feed) { $category = $categories[$feed->categoryId()] ?? null; if ($category !== null) { @@ -576,7 +572,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController { $mark_updated_article_unread = $feed->attributeBoolean('mark_updated_article_unread') ?? FreshRSS_Context::userConf()->mark_updated_article_unread; // For this feed, check existing GUIDs already in database. - $existingHashForGuids = $entryDAO->listHashForFeedGuids($feed->id(), $newGuids) ?: []; + $existingHashForGuids = $entryDAO->listHashForFeedGuids($feed->id(), $newGuids); /** @var array<string,bool> $newGuids */ $newGuids = []; |
