Skip to content

Commit

Permalink
Merge pull request #2991 from MrWaloo/alpha
Browse files Browse the repository at this point in the history
Performance increase while importing an equipment without removing existing commands
  • Loading branch information
zoic21 authored Dec 17, 2024
2 parents 94aa378 + b907d62 commit 69d3727
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions core/class/eqLogic.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1375,18 +1375,18 @@ public function import($_configuration, $_dontRemove = false) {
$link_actions = array();
$arrayToRemove = [];
if (isset($_configuration['commands'])) {
foreach (($this->getCmd()) as $eqLogic_cmd) {
$exists = 0;
foreach ($_configuration['commands'] as $command) {
if (isset($command['logicalId']) && $command['logicalId'] == $eqLogic_cmd->getLogicalId()) {
$exists++;
if (!$_dontRemove) {
foreach (($this->getCmd()) as $eqLogic_cmd) {
$exists = 0;
foreach ($_configuration['commands'] as $command) {
if (isset($command['logicalId']) && $command['logicalId'] == $eqLogic_cmd->getLogicalId()) {
$exists++;
}
}
if ($exists < 1) {
$arrayToRemove[] = $eqLogic_cmd;
}
}
if ($exists < 1) {
$arrayToRemove[] = $eqLogic_cmd;
}
}
if (!$_dontRemove) {
foreach ($arrayToRemove as $cmdToRemove) {
try {
$cmdToRemove->remove();
Expand Down

0 comments on commit 69d3727

Please sign in to comment.