No need to fetch bounds if they are not required.
authorStéphane Jacob <sj@m4x.org>
Tue, 2 Mar 2010 20:20:11 +0000 (21:20 +0100)
committerStéphane Jacob <sj@m4x.org>
Tue, 2 Mar 2010 20:20:11 +0000 (21:20 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/plset.php

index b838fc9..985b5be 100644 (file)
@@ -312,9 +312,9 @@ abstract class MultipageView implements PlView
         $res = $this->set->get($this->limit());
 
         $show_bounds = $this->bounds();
-        $start = current($res);
-        $end   = end($res);
         if ($show_bounds) {
+            $start = current($res);
+            $end   = end($res);
             if ($show_bounds == 1) {
                 $first = $this->getBoundValue($start);
                 $last  = $this->getBoundValue($end);