From 36b1cc8516dac2a3c6cda6cba1d1fa1337eb1f6d 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 1adb326e37..30fe54eb53 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