From: Roland Haeder Date: Wed, 13 Jan 2016 16:28:28 +0000 (+0100) Subject: Save some else blocks that makes the code just more complex. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ab7376ab43673ce5c301fb34f4845b53b1f765a4;p=quix0rs-gnu-social.git Save some else blocks that makes the code just more complex. Signed-off-by: Roland Haeder --- diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index aa4f6b7bc6..240bc8952f 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -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)) {