r97744 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97743‎ | r97744 | r97745 >
Date:16:34, 21 September 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Comment out unreachable code

Remove unreachable return false;
Modified paths:
  • /trunk/phase3/includes/Export.php (modified) (history)
  • /trunk/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Export.php
@@ -480,10 +480,10 @@
481481 */
482482 function closePage() {
483483 return " </page>\n";
484 - if ( !$this->firstPageWritten ) {
485 - $this->firstPageWritten = $this->pageInProgress;
486 - }
487 - $this->lastPageWritten = $this->pageInProgress;
 484+ //if ( !$this->firstPageWritten ) {
 485+ // $this->firstPageWritten = $this->pageInProgress;
 486+ //}
 487+ //$this->lastPageWritten = $this->pageInProgress;
488488 }
489489
490490 /**
@@ -711,7 +711,7 @@
712712
713713 /**
714714 * Close the old file, and move it to a specified name.
715 - * Use this for the last piece of a file written out
 715+ * Use this for the last piece of a file written out
716716 * at specified checkpoints (e.g. every n hours).
717717 * @param $newname mixed File name. May be a string or an array with one element
718718 * @param $open bool If true, a new file with the old filename will be opened again for writing (default: false)
Index: trunk/phase3/includes/WebRequest.php
@@ -876,8 +876,6 @@
877877 }
878878 throw new HttpError( 403,
879879 'Invalid file extension found in the path info or query string.' );
880 -
881 - return false;
882880 }
883881 return true;
884882 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95260add functions that support close and rename of output files as they are being...ariel22:01, 22 August 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   21:54, 21 September 2011

Commenting code out is a bit of a smell -- if it should be removed it should be removed outright. If it's just wrong, then it needs fixin'.

#Comment by Reedy (talk | contribs)   21:56, 21 September 2011

The return dates back to you adding it in r11173, but both Roan and Ariel have touched the code after it, in r96275 and r95260

#Comment by Brion VIBBER (talk | contribs)   21:58, 21 September 2011

The unreachable code was added in r95260 -- it has never been reachable. I've marked that rev as a fixme.

#Comment by 😂 (talk | contribs)   00:38, 3 November 2011

Resolved with r97800.

Status & tagging log