]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Save some else blocks that makes the code just more complex.
authorRoland Haeder <roland@mxchange.org>
Wed, 13 Jan 2016 16:28:28 +0000 (17:28 +0100)
committerRoland Haeder <roland@mxchange.org>
Wed, 13 Jan 2016 16:29:39 +0000 (17:29 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
lib/noticelistitem.php

index 1adb326e371a6e36f8310d68148119283f001993..30fe54eb53c4f2acd270e1bf36593351ba55c06c 100644 (file)
@@ -76,20 +76,19 @@ class NoticeListItem extends Widget
     function __construct(Notice $notice, Action $out=null, array $prefs=array())
     {
         parent::__construct($out);
+
+        $this->notice  = $notice;
+
         if (!empty($notice->repeat_of)) {
             $original = Notice::getKV('id', $notice->repeat_of);
-            if (!$original instanceof Notice) { // could have been deleted
-                $this->notice = $notice;
-            } else {
+            if ($original instanceof Notice) { // could have been deleted
                 $this->notice = $original;
                 $this->repeat = $notice;
             }
-        } else {
-            $this->notice  = $notice;
         }
 
         $this->profile = $this->notice->getProfile();
-        
+
         // integer preferences
         foreach(array('maxchars') as $key) {
             if (array_key_exists($key, $prefs)) {