From 06dc95e34f0e4e1721cd11a3a9a15c8fe6e1de7e Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Thu, 6 Dec 2012 13:53:41 -0500
Subject: [PATCH] Made removeFilter() more efficient with foreach loop.

---
 module/VuFind/src/VuFind/Search/Base/Params.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php
index 0718b20f533..03a3f5dc72c 100644
--- a/module/VuFind/src/VuFind/Search/Base/Params.php
+++ b/module/VuFind/src/VuFind/Search/Base/Params.php
@@ -917,9 +917,9 @@ class Params implements ServiceLocatorAwareInterface
             $rebuildArray = false;
 
             // Loop through all filters on the field
-            for ($i = 0; $i < count($this->filterList[$field]); $i++) {
+            foreach ($this->filterList[$field] as $i => $currentFilter) {
                 // Does it contain the value we don't want?
-                if ($this->filterList[$field][$i] == $value) {
+                if ($currentFilter == $value) {
                     // If so remove it.
                     unset($this->filterList[$field][$i]);
 
-- 
GitLab