Withoutaname has uploaded a new change for review.

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

Change subject: Shorten ternary expressions in RawAction.php
......................................................................

Shorten ternary expressions in RawAction.php

Change-Id: Idc9e74344989bf1394e05ebaf23cfd9a8fb38e1a
---
M includes/actions/RawAction.php
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/148597/1

diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php
index 4baf7b9..bbe5497 100644
--- a/includes/actions/RawAction.php
+++ b/includes/actions/RawAction.php
@@ -206,9 +206,8 @@
                        case 'next':
                                # output next revision, or nothing if there 
isn't one
                                if ( $oldid ) {
-                                       $oldid = 
$this->getTitle()->getNextRevisionID( $oldid );
+                                       $oldid = 
$this->getTitle()->getNextRevisionID( $oldid ) ?: -1;
                                }
-                               $oldid = $oldid ? $oldid : -1;
                                break;
                        case 'prev':
                                # output previous revision, or nothing if there 
isn't one
@@ -216,8 +215,7 @@
                                        # get the current revision so we can 
get the penultimate one
                                        $oldid = $this->page->getLatest();
                                }
-                               $prev = 
$this->getTitle()->getPreviousRevisionID( $oldid );
-                               $oldid = $prev ? $prev : -1;
+                               $oldid = 
$this->getTitle()->getPreviousRevisionID( $oldid ) ?: -1;
                                break;
                        case 'cur':
                                $oldid = 0;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc9e74344989bf1394e05ebaf23cfd9a8fb38e1a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Withoutaname <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to