From: Derick Alangi Date: Fri, 11 Jan 2019 15:49:44 +0000 (+0100) Subject: block: Avoid use of is_null() PHP function where necessary X-Git-Tag: 1.34.0-rc.0~3096^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=78b005d86d5582aa47687f7622c9987312c3c368;p=lhc%2Fweb%2Fwiklou.git block: 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: I83cd7a6ca49acc548a7f46b2c37dfa189889bd19 --- diff --git a/includes/block/BlockRestriction.php b/includes/block/BlockRestriction.php index 5fe965001d..3baa063af9 100644 --- a/includes/block/BlockRestriction.php +++ b/includes/block/BlockRestriction.php @@ -38,7 +38,7 @@ class BlockRestriction { * @return Restriction[] */ public static function loadByBlockId( $blockId, IDatabase $db = null ) { - if ( is_null( $blockId ) || $blockId === [] ) { + if ( $blockId === null || $blockId === [] ) { return []; }