From: moodler Date: Fri, 5 Oct 2007 06:32:53 +0000 (+0000) Subject: Small efficiency improvement for print_user_picture() when it does access the db X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b649ef92e37d850c194ce6d77f18bc01e2447035;p=moodle.git Small efficiency improvement for print_user_picture() when it does access the db --- diff --git a/lib/weblib.php b/lib/weblib.php index cc8ee571a9..9f5abfc763 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3788,12 +3788,12 @@ function print_user_picture($user, $courseid, $picture=NULL, $size=0, $return=fa $userobj = new StdClass; // fake it to save DB traffic $userobj->id = $user; $userobj->picture = $picture; - $user = $userobj; + $user = clone($userobj); unset($userobj); } } if ($needrec) { - $user = get_record('user','id',$user); + $user = get_record('user','id',$user, '', '', '', '', 'id,firstname,lastname,imagealt'); } if ($link) { @@ -6548,4 +6548,4 @@ function fix_align_rtl($align) { // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140: -?> \ No newline at end of file +?>