diff --git a/core/modules/views/src/Plugin/views/pager/Mini.php b/core/modules/views/src/Plugin/views/pager/Mini.php
index 5f1750e..2547d33 100644
--- a/core/modules/views/src/Plugin/views/pager/Mini.php
+++ b/core/modules/views/src/Plugin/views/pager/Mini.php
@@ -73,15 +73,11 @@ public function postExecute(&$result) {
     // the next link needs to be displayed and the item removed.
     if ($this->getItemsPerPage() > 0 && count($result) > $this->getItemsPerPage()) {
       array_pop($result);
-      // Make sure the pager shows the next link by setting the total items to
-      // the biggest possible number but prevent failing calculations like
-      // ceil(PHP_INT_MAX) we take PHP_INT_MAX / 2.
-      $total = PHP_INT_MAX / 2;
     }
     else {
       $total = $this->getCurrentPage() * $this->getItemsPerPage() + count($result);
+      $this->total_items = $total;
     }
-    $this->total_items = $total;
   }
 
   /**
