Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-09-17 04:36:04 +0400
committerRobin Appelman <icewind1991@gmail.com>2011-09-17 04:49:40 +0400
commit8c7aa060884fb3eaa1fe39412eb7622b743478b4 (patch)
tree51a55400017292353dbf85ef4ef1bb7c45c2ba4f /lib/appconfig.php
parentd0d3fecc9502733fadfa358bcb5e0e2baf46f224 (diff)
dont use numRows when it's not needed since it can be expensive
Diffstat (limited to 'lib/appconfig.php')
-rw-r--r--lib/appconfig.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/appconfig.php b/lib/appconfig.php
index c64a15b8938..392782b2586 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -93,14 +93,12 @@ class OC_Appconfig{
// At least some magic in here :-)
$query = OC_DB::prepare( 'SELECT configvalue FROM *PREFIX*appconfig WHERE appid = ? AND configkey = ?' );
$result = $query->execute( array( $app, $key ));
-
- if( !$result->numRows()){
+ $row = $result->fetchRow();
+ if($row){
+ return $row["configvalue"];
+ }else{
return $default;
}
-
- $row = $result->fetchRow();
-
- return $row["configvalue"];
}
/**