From db635855f2e3c75ed455b7b549359f94c47752b4 Mon Sep 17 00:00:00 2001 From: withoutaname Date: Tue, 22 Jul 2014 21:13:47 -0700 Subject: [PATCH] Shorten ternary expressions in RawAction.php Change-Id: Idc9e74344989bf1394e05ebaf23cfd9a8fb38e1a --- includes/actions/RawAction.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php index 4baf7b9c4a..37e6e667e8 100644 --- a/includes/actions/RawAction.php +++ b/includes/actions/RawAction.php @@ -205,10 +205,11 @@ class RawAction extends FormlessAction { switch ( $this->getRequest()->getText( 'direction' ) ) { case 'next': # output next revision, or nothing if there isn't one + $nextid = 0; if ( $oldid ) { - $oldid = $this->getTitle()->getNextRevisionID( $oldid ); + $nextid = $this->getTitle()->getNextRevisionID( $oldid ); } - $oldid = $oldid ? $oldid : -1; + $oldid = $nextid ?: -1; break; case 'prev': # output previous revision, or nothing if there isn't one @@ -216,8 +217,8 @@ class RawAction extends FormlessAction { # get the current revision so we can get the penultimate one $oldid = $this->page->getLatest(); } - $prev = $this->getTitle()->getPreviousRevisionID( $oldid ); - $oldid = $prev ? $prev : -1; + $previd = $this->getTitle()->getPreviousRevisionID( $oldid ); + $oldid = $previd ?: -1; break; case 'cur': $oldid = 0; -- 2.20.1