diff options
author | Anna Larch <anna@nextcloud.com> | 2022-08-15 20:27:02 +0200 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2022-08-15 20:47:58 +0200 |
commit | 61b55c88dae27279ffe825a2ef69024af78f4874 (patch) | |
tree | b13be9593e15ad329dd1795e42b03540f35c7e22 /apps/dav | |
parent | 1405b7a8ca43b5565a8c0427854bd01efd426402 (diff) | |
download | nextcloud-server-61b55c88dae27279ffe825a2ef69024af78f4874.tar.gz nextcloud-server-61b55c88dae27279ffe825a2ef69024af78f4874.zip |
performance optimisation for carddav backend blob data read
Signed-off-by: Anna Larch <anna@nextcloud.com>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/CardDAV/CardDavBackend.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index a9ca2eb30a3..6b60d6701d4 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -933,6 +933,12 @@ class CardDavBackend implements BackendInterface, SyncSupport { $cardData = stream_get_contents($cardData); } + // Micro optimisation + // don't loop through + if (strpos($cardData, 'PHOTO:data:') === 0) { + return $cardData; + } + $cardDataArray = explode("\r\n", $cardData); $cardDataFiltered = []; @@ -956,7 +962,6 @@ class CardDavBackend implements BackendInterface, SyncSupport { $cardDataFiltered[] = $line; } - return implode("\r\n", $cardDataFiltered); } |