From 6103ddabf2e10cf69d48435a62739ee03d706a8c Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Mon, 13 Jan 2014 21:13:04 +0100 Subject: [PATCH] Skip loading offset on empty filter --- src/DebugBar/Storage/FileStorage.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DebugBar/Storage/FileStorage.php b/src/DebugBar/Storage/FileStorage.php index 17675c3..8b91980 100644 --- a/src/DebugBar/Storage/FileStorage.php +++ b/src/DebugBar/Storage/FileStorage.php @@ -67,7 +67,13 @@ class FileStorage implements StorageInterface //Load the metadata and filter the results. $results = array(); + $i = 0; foreach ($files as $file) { + //When filter is empty, skip loading the offset + if($i++ < $offset && empty($filters)){ + $results[] = null; + continue; + } $data = $this->get($file['id']); $meta = $data['__meta']; unset($data);