From 78b005d86d5582aa47687f7622c9987312c3c368 Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Fri, 11 Jan 2019 16:49:44 +0100 Subject: [PATCH] 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 --- includes/block/BlockRestriction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 []; } -- 2.20.1