aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/db/statementwrapper.php
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 /lib/private/db/statementwrapper.php
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 'lib/private/db/statementwrapper.php')
-rw-r--r--lib/private/db/statementwrapper.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/db/statementwrapper.php b/lib/private/db/statementwrapper.php
index 93fabc147ca..ad63de98e93 100644
--- a/lib/private/db/statementwrapper.php
+++ b/lib/private/db/statementwrapper.php
@@ -89,9 +89,10 @@ class OC_DB_StatementWrapper {
$cArg = 0;
$inSubstring = false;
+ $queryLength = strlen($query);
// Create new query
- for ($i = 0; $i < strlen ($query); $i++) {
+ for ($i = 0; $i < $queryLength; $i++) {
if ($inSubstring == false) {
// Defines when we should start inserting values
if (substr ($query, $i, 9) == 'SUBSTRING') {