From d060180140923ac054b252f0cbd821063a53f5b7 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Thu, 23 Oct 2014 23:27:15 +0200 Subject: Use function outside of loop Otherwise the function is executed n times which is a lot of overhead --- lib/private/ocsclient.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/private/ocsclient.php') diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php index 8ceb43f4c1f..351027d8018 100644 --- a/lib/private/ocsclient.php +++ b/lib/private/ocsclient.php @@ -129,8 +129,9 @@ class OC_OCSClient{ $data = simplexml_load_string($xml); libxml_disable_entity_loader($loadEntities); - $tmp=$data->data->content; - for($i = 0; $i < count($tmp); $i++) { + $tmp = $data->data->content; + $tmpCount = count($tmp); + for($i = 0; $i < $tmpCount; $i++) { $app=array(); $app['id']=(string)$tmp[$i]->id; $app['name']=(string)$tmp[$i]->name; -- cgit v1.2.3