summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-23 23:27:15 +0200
committerLukas Reschke <lukas@owncloud.com>2014-10-24 12:27:53 +0200
commitd060180140923ac054b252f0cbd821063a53f5b7 (patch)
tree59d53bb16be35960f493709d8409a75bc79be47e /apps/files_external
parent9739a25547e5f8f7500b0a962780cb9267b47cd1 (diff)
downloadnextcloud-server-d060180140923ac054b252f0cbd821063a53f5b7.tar.gz
nextcloud-server-d060180140923ac054b252f0cbd821063a53f5b7.zip
Use function outside of loop
Otherwise the function is executed n times which is a lot of overhead
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/config.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 92bb891ca21..5378137e1d3 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -716,10 +716,11 @@ class OC_Mount_Config {
}
}
- if (count($dependencyGroup) > 0) {
+ $dependencyGroupCount = count($dependencyGroup);
+ if ($dependencyGroupCount > 0) {
$backends = '';
- for ($i = 0; $i < count($dependencyGroup); $i++) {
- if ($i > 0 && $i === count($dependencyGroup) - 1) {
+ for ($i = 0; $i < $dependencyGroupCount; $i++) {
+ if ($i > 0 && $i === $dependencyGroupCount - 1) {
$backends .= $l->t(' and ');
} elseif ($i > 0) {
$backends .= ', ';