dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3f45c8
)
block: Avoid use of is_null() PHP function where necessary
author
Derick Alangi
<alangiderick@gmail.com>
Fri, 11 Jan 2019 15:49:44 +0000
(16:49 +0100)
committer
Derick Alangi
<alangiderick@gmail.com>
Fri, 11 Jan 2019 15:49:44 +0000
(16:49 +0100)
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
patch
|
blob
|
history
diff --git
a/includes/block/BlockRestriction.php
b/includes/block/BlockRestriction.php
index
5fe9650
..
3baa063
100644
(file)
--- 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 [];
}