early returns to avoid long code in if / else
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 7 Nov 2011 14:57:55 +0000 (14:57 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 7 Nov 2011 14:57:55 +0000 (14:57 +0000)
commitc20f7be60f79891a53f641f783008055b30297e4
tree0ca157b389583a40a11647d5d4ca531f56002ad2
parent3b64e6b919a9f094d6b211b5d3bfde3ece807a85
early returns to avoid long code in if / else

Instead of enclosing a lot of code in a if() {} block. I reverted the logic
to exit early. That makes code a bit easier to read.

Logic was:
 if( $title->getNamespace() >= 0 && !$accErrors && $newid ) {
   // LOT OF CODE
 }
 return;

Now:
 if( $title->getNamespace() < 0 || $accErrors || !$newid ) {
   return;
 }
 // LOT OF CODE
includes/FeedUtils.php