You are here

protected function QueueWorker::removeDuplicates in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 4.x src/Queue/QueueWorker.php \Drupal\simple_sitemap\Queue\QueueWorker::removeDuplicates()

Parameters

array $results:

1 call to QueueWorker::removeDuplicates()
QueueWorker::generateResultsFromElement in src/Queue/QueueWorker.php

File

src/Queue/QueueWorker.php, line 306

Class

QueueWorker

Namespace

Drupal\simple_sitemap\Queue

Code

protected function removeDuplicates(&$results) {
  if ($this->generatorSettings['remove_duplicates'] && !empty($results)) {
    $result = $results[key($results)];
    if (isset($result['meta']['path'])) {
      if (isset($this->processedPaths[$result['meta']['path']])) {
        $results = [];
      }
      else {
        $this->processedPaths[$result['meta']['path']] = TRUE;
      }
    }
  }
}