From 45c85311b3f68e85bd66d910f1e486560d701310 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 19 Jan 2023 07:43:02 -0500 Subject: [PATCH] Optimization to prevent overhead when PagesRaw.find() matches no pages --- wire/core/PagesRaw.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wire/core/PagesRaw.php b/wire/core/PagesRaw.php index fbd480cb..d15b8f75 100644 --- a/wire/core/PagesRaw.php +++ b/wire/core/PagesRaw.php @@ -781,6 +781,8 @@ class PagesRawFinder extends Wire { $templatesById = array(); $getPaths = $this->getPaths; + if(empty($this->selector)) return; + foreach($this->findIDs($this->selector, '*') as $row) { $id = (int) $row['id']; $this->ids[$id] = $id;