User "Siebrand" posted a comment on MediaWiki.r93528.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93528#c20306
Commit summary:

Added TitleBlacklist::singleton() to get an instance of the TitleBlacklist 
instead of having to use $wgTitleBlacklist and call efInitTitleBlacklist()

Comment:

Time to learn for me, or I may have spotted a bug :)

<source lang="php">+    public static function singleton() {
+        static $instance = null;
+
+        if ( $instance === null ) {
+            $instance = new self;
+        }
+        return $instance;
+    }
</source>

If you set $instance to null each time, then will it not always === null?

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to