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=36b1cc8516dac2a3c6cda6cba1d1fa1337eb1f6d;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 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)) {