1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-11 17:24:46 +02:00

Optimization to prevent overhead when PagesRaw.find() matches no pages

This commit is contained in:
Ryan Cramer
2023-01-19 07:43:02 -05:00
parent 2c65cbaa5b
commit 45c85311b3

View File

@@ -781,6 +781,8 @@ class PagesRawFinder extends Wire {
$templatesById = array(); $templatesById = array();
$getPaths = $this->getPaths; $getPaths = $this->getPaths;
if(empty($this->selector)) return;
foreach($this->findIDs($this->selector, '*') as $row) { foreach($this->findIDs($this->selector, '*') as $row) {
$id = (int) $row['id']; $id = (int) $row['id'];
$this->ids[$id] = $id; $this->ids[$id] = $id;