From ab7376ab43673ce5c301fb34f4845b53b1f765a4 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 13 Jan 2016 17:28:28 +0100 Subject: [PATCH] Save some else blocks that makes the code just more complex. Signed-off-by: Roland Haeder --- lib/noticelistitem.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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)) { -- 2.39.5