Remove a few obscure "done" and "empty" comments
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Wed, 9 Jan 2019 16:15:21 +0000 (17:15 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Wed, 30 Jan 2019 20:35:14 +0000 (20:35 +0000)
These don't add any knowledge to what is already obvious from the
code, I find.

Change-Id: Ia613b6a059f78dbeefdfd020899bd1a6e239a731

12 files changed:
includes/FileDeleteForm.php
includes/Storage/PageUpdater.php
includes/block/BlockRestriction.php
includes/diff/DifferenceEngine.php
includes/logging/LogPage.php
includes/revisiondelete/RevisionDeleteUser.php
maintenance/Maintenance.php
maintenance/cleanupEmptyCategories.php
maintenance/cleanupPreferences.php
maintenance/deleteOldRevisions.php
maintenance/importImages.php
tests/phpunit/includes/filebackend/FileBackendTest.php

index 3e0595e..8866a88 100644 (file)
@@ -229,7 +229,6 @@ class FileDeleteForm {
                                        $lbFactory->rollbackMasterChanges( __METHOD__ );
                                }
                        } else {
-                               // Done; nothing changed
                                $dbw->endAtomic( __METHOD__ );
                        }
                }
index 6cbdcc6..e25f0f0 100644 (file)
@@ -1104,10 +1104,10 @@ class PageUpdater {
                // TODO: move to storage service
                $newid = $wikiPage->insertOn( $dbw );
                if ( $newid === false ) {
-                       $dbw->endAtomic( __METHOD__ ); // nothing inserted
+                       $dbw->endAtomic( __METHOD__ );
                        $status->fatal( 'edit-already-exists' );
 
-                       return $status; // nothing done
+                       return $status;
                }
 
                // At this point we are now comitted to returning an OK
index b5574f9..72f6eaa 100644 (file)
@@ -149,7 +149,6 @@ class BlockRestriction {
                                $restrictions
                        );
 
-                       // Nothing to remove.
                        if ( empty( $restrictionsToRemove ) ) {
                                continue;
                        }
index 8ca480f..8540756 100644 (file)
@@ -1463,7 +1463,7 @@ class DifferenceEngine extends ContextSource {
                        return self::intermediateEditsMsg( $nEdits, $numUsers, $limit );
                }
 
-               return ''; // nothing
+               return '';
        }
 
        /**
index b63f818..45d6e1f 100644 (file)
@@ -385,7 +385,7 @@ class LogPage {
         */
        public function addRelations( $field, $values, $logid ) {
                if ( !strlen( $field ) || empty( $values ) ) {
-                       return false; // nothing
+                       return false;
                }
 
                $data = [];
index 19fe0c3..34b624f 100644 (file)
@@ -191,7 +191,6 @@ class RevisionDeleteUser {
                        __METHOD__
                );
 
-               # Done!
                return true;
        }
 
index e76426d..71d12ee 100644 (file)
@@ -1326,7 +1326,6 @@ abstract class Maintenance {
                        $this->output( "done.\n" );
                }
 
-               # Done
                $this->commitTransaction( $dbw, __METHOD__ );
        }
 
index 786c20a..922b32e 100644 (file)
@@ -116,7 +116,6 @@ TEXT
                                        ]
                                );
                                if ( !$rows || $rows->numRows() <= 0 ) {
-                                       # Done, hopefully.
                                        break;
                                }
 
@@ -170,7 +169,6 @@ TEXT
                                        ]
                                );
                                if ( !$rows || $rows->numRows() <= 0 ) {
-                                       # Done, hopefully.
                                        break;
                                }
                                foreach ( $rows as $row ) {
index b24d72d..a52ce17 100644 (file)
@@ -118,7 +118,6 @@ class CleanupPreferences extends Maintenance {
                        $numRows = $res->numRows();
                        $total += $numRows;
                        if ( $res->numRows() <= 0 ) {
-                               // All done!
                                $this->output( "DONE! (handled $total entries)\n" );
                                break;
                        }
index fc43e22..56576d9 100644 (file)
@@ -90,7 +90,6 @@ class DeleteOldRevisions extends Maintenance {
                        $this->output( "done.\n" );
                }
 
-               # This bit's done
                # Purge redundant text records
                $this->commitTransaction( $dbw, __METHOD__ );
                if ( $delete ) {
index 5db1fa8..7a2e0f4 100644 (file)
@@ -335,7 +335,6 @@ class ImportImages extends Maintenance {
                                        $props,
                                        $timestamp
                                )->isOK() ) {
-                                       # We're done!
                                        $this->output( "done.\n" );
 
                                        $doProtect = false;
index f570f55..4dc2f9e 100644 (file)
@@ -350,7 +350,7 @@ class FileBackendTest extends MediaWikiTestCase {
                        $this->assertEquals( false, $this->backend->fileExists( [ 'src' => $dest ] ),
                                "Destination file $dest does not exist ($backendName)." );
 
-                       return; // done
+                       return;
                }
 
                $status = $this->backend->doOperation(
@@ -470,7 +470,7 @@ class FileBackendTest extends MediaWikiTestCase {
                        $this->assertEquals( false, $this->backend->fileExists( [ 'src' => $dest ] ),
                                "Destination file $dest does not exist ($backendName)." );
 
-                       return; // done
+                       return;
                }
 
                $status = $this->backend->doOperation(