From fb899c313c9cdf4d6b0529c53d2b647999ad94db Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 6 Dec 2009 21:28:40 -0800 Subject: Further simplifications to viewable(). Stop trying to optimize for the case where we just have one restriction, it's unnecessary. --- modules/gallery/helpers/item.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index 300a6942..b7be23cd 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -158,17 +158,9 @@ class item_Core { $view_restrictions["items.view_$id"] = access::ALLOW; } } - switch (count($view_restrictions)) { - case 0: - break; - case 1: - $model->where($view_restrictions[0], "=", access::ALLOW); - break; - - default: + if (count($view_restrictions)) { $model->and_open()->or_where($view_restrictions)->close(); - break; } return $model; -- cgit v1.2.3