From: Derick Alangi Date: Fri, 11 Jan 2019 15:40:27 +0000 (+0100) Subject: actions: Avoid use of is_null() PHP function where necessary X-Git-Tag: 1.34.0-rc.0~3098^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=2b3a21f5c1c69fb1e03af717bb5b50037436d13c;p=lhc%2Fweb%2Fwiklou.git actions: Avoid use of is_null() PHP function where necessary WRT performance, is_null() is a few nanoseconds slower than === null due to function call overhead. Also, I personally think using the identical check on null is slightly more readable than using is_null(). Change-Id: Ie5b1ac17a18907e92eb3042decb7fc75e903123d --- diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index d6b80570ed..fdf4f85336 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -511,7 +511,7 @@ class HistoryPager extends ReverseChronologicalPager { if ( $row->rev_parent_id ) { $revIds[] = $row->rev_parent_id; } - if ( !is_null( $row->user_name ) ) { + if ( $row->user_name !== null ) { $batch->add( NS_USER, $row->user_name ); $batch->add( NS_USER_TALK, $row->user_name ); } else { # for anons or usernames of imported revisions