Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/78530


Change subject: Minor code tweaks
......................................................................

Minor code tweaks

Boolean simplification and braces

Change-Id: I2e8a4fe244e030c230a1aeb595ca056160b7f90d
---
M backend/CodeRepository.php
M backend/CodeRevision.php
M backend/Subversion.php
M ui/CodeRevisionView.php
4 files changed, 5 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeReview 
refs/changes/30/78530/1

diff --git a/backend/CodeRepository.php b/backend/CodeRepository.php
index 122a29c..43607dc 100644
--- a/backend/CodeRepository.php
+++ b/backend/CodeRepository.php
@@ -454,10 +454,7 @@
         */
        public function isValidRev( $rev ) {
                $rev = intval( $rev );
-               if ( $rev > 0 && $rev <= $this->getLastStoredRev() ) {
-                       return true;
-               }
-               return false;
+               return ( $rev > 0 && $rev <= $this->getLastStoredRev() );
        }
 
        /**
diff --git a/backend/CodeRevision.php b/backend/CodeRevision.php
index a53b746..658c2bb 100644
--- a/backend/CodeRevision.php
+++ b/backend/CodeRevision.php
@@ -633,10 +633,7 @@
        public function isDiffable() {
                global $wgCodeReviewMaxDiffPaths;
                $paths = $this->getModifiedPaths();
-               if ( !$paths->numRows() || ( $wgCodeReviewMaxDiffPaths > 0 && 
$paths->numRows() > $wgCodeReviewMaxDiffPaths ) ) {
-                       return false; // things need to get done this year
-               }
-               return true;
+               return $paths->numRows() && ( $wgCodeReviewMaxDiffPaths > 0 && 
$paths->numRows() < $wgCodeReviewMaxDiffPaths );
        }
 
        /**
diff --git a/backend/Subversion.php b/backend/Subversion.php
index 6f6c7ad..de5e5f2 100644
--- a/backend/Subversion.php
+++ b/backend/Subversion.php
@@ -291,10 +291,11 @@
                        wfEscapeShellArg( $this->mRepoPath . $path ) );
                $document = new DOMDocument();
 
-               if ( !@$document->loadXML( wfShellExec( $command ) ) )
+               if ( !@$document->loadXML( wfShellExec( $command ) ) ) {
                        // svn list --xml returns invalid XML if the file does 
not exist
                        // FIXME: report bug upstream
                        return false;
+               }
 
                $entries = $document->getElementsByTagName( 'entry' );
                $result = array();
diff --git a/ui/CodeRevisionView.php b/ui/CodeRevisionView.php
index dc59aac..51da19b 100644
--- a/ui/CodeRevisionView.php
+++ b/ui/CodeRevisionView.php
@@ -475,7 +475,7 @@
                        $cache = '';
                }
                $diff = $this->mRepo->getDiff( $this->mRev->getId(), $cache );
-               if ( is_integer($diff) && $deferDiffs ) {
+               if ( is_integer( $diff ) && $deferDiffs ) {
                        // We'll try loading it by AJAX...
                        return $this->stubDiffLoader();
                } elseif ( strlen( $diff ) > $wgCodeReviewMaxDiffSize ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/78530
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e8a4fe244e030c230a1aeb595ca056160b7f90d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeReview
Gerrit-Branch: master
Gerrit-Owner: Reedy <re...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to