From ae1fdf73c2d63692162433c6f4c37d80941787ca Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 13 Sep 2017 21:42:47 +0200 Subject: [PATCH] Improve sharing pagination Basically we did in almost all cases did a query to much. This resulted in an extra query for each share type. Signed-off-by: Roeland Jago Douma --- lib/private/Share20/Manager.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 6546fc48141..b4c4c7292fd 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1053,6 +1053,11 @@ class Manager implements IManager { } } + // If we did not fetch more shares than the limit then there are no more shares + if (count($shares) < $limit) { + break; + } + if (count($shares2) === $limit) { break; }