"Krinkle" posted a comment on MediaWiki.r113518.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113518#c32065
Commit summary for MediaWiki.r113518:
No need to create a new Revision object if we already have one available
Krinkle's comment:
No, I was looking at the code as of this rev (that rev was before this one).
<pre>
if ( $oldid === $this->mPage->getLatest() ) {
$this->mRevision = $this->mPage->getRevision();
} else {
$this->mRevision = Revision::newFromId( $oldid
);
</pre>
I don't know the context here, but if it's possible that mRevision is already
defined, it could use an additional <code> if ( $this->mRevision &&
$this->mRevision->getId() !== $oldid ) { $this->mRevision =
Revision::newFromId( $oldid ); }</code> wrap.
If not, then it's perfectly fine.
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview