From 9901e789b60fd4a811e18850ed1b53ad3639d19b Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 25 Apr 2021 17:35:29 +1200 Subject: [PATCH] [REF] Remove redundant code --- CRM/Contact/BAO/GroupContactCache.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 3e75e851333f..d7ec02f7bb12 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -132,7 +132,6 @@ public static function loadAll($groupIDs = NULL, $limit = 0) { // this function is expensive and should be sparingly used if groupIDs is empty if (empty($groupIDs)) { $groupIDClause = NULL; - $groupIDs = []; } else { if (!is_array($groupIDs)) { @@ -162,27 +161,8 @@ public static function loadAll($groupIDs = NULL, $limit = 0) { $dao = CRM_Core_DAO::executeQuery($query); $processGroupIDs = []; - $refreshGroupIDs = $groupIDs; while ($dao->fetch()) { $processGroupIDs[] = $dao->id; - - // remove this id from refreshGroupIDs - foreach ($refreshGroupIDs as $idx => $gid) { - if ($gid == $dao->id) { - unset($refreshGroupIDs[$idx]); - break; - } - } - } - - if (!empty($refreshGroupIDs)) { - $refreshGroupIDString = CRM_Core_DAO::escapeString(implode(', ', $refreshGroupIDs)); - $query = " -UPDATE civicrm_group g -SET g.cache_date = NOW() -WHERE g.id IN ( {$refreshGroupIDString} ) -"; - CRM_Core_DAO::executeQuery($query); } if (empty($processGroupIDs)) {