From 8c7aa060884fb3eaa1fe39412eb7622b743478b4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sat, 17 Sep 2011 02:36:04 +0200 Subject: dont use numRows when it's not needed since it can be expensive --- lib/user/database.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/user') diff --git a/lib/user/database.php b/lib/user/database.php index f29aaf00f05..452709c1fb9 100644 --- a/lib/user/database.php +++ b/lib/user/database.php @@ -106,8 +106,8 @@ class OC_User_Database extends OC_User_Backend { $query = OC_DB::prepare( "SELECT uid FROM *PREFIX*users WHERE uid LIKE ? AND password = ?" ); $result = $query->execute( array( $uid, sha1( $password ))); - if( $result->numRows() > 0 ){ - $row=$result->fetchRow(); + $row=$result->fetchRow(); + if($row){ return $row['uid']; }else{ return false; -- cgit v1.2.3