From 53d40a465408549a8518dbfd9ee0a4489a2480b1 Mon Sep 17 00:00:00 2001 From: javalizard <> Date: Mon, 4 Oct 2010 04:25:57 +0000 Subject: #247 Tweaked the appending function --- framework/Collections/TPriorityList.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'framework/Collections/TPriorityList.php') diff --git a/framework/Collections/TPriorityList.php b/framework/Collections/TPriorityList.php index 1b7cff32..41d6a03f 100644 --- a/framework/Collections/TPriorityList.php +++ b/framework/Collections/TPriorityList.php @@ -319,10 +319,8 @@ class TPriorityList extends TList else $cc+=count($items); - if($index === false) { + if($index === false && isset($this->_d[$priority])) { $c = count($this->_d[$priority]); - if(!$c && $this->_c) // no items at this priority, but there exist items in this list - $this->_o = false; $c += $cc; $this->_d[$priority][]=$item; } else if(isset($this->_d[$priority])) { @@ -338,10 +336,8 @@ class TPriorityList extends TList array_splice($this->_fd,$c,0,array($item)); } else { $c = null; - if($index === false) { + if($index === false && isset($this->_d[$priority])) { $cc = count($this->_d[$priority]); - if(!$cc && $this->_c) - $this->_o = false; $this->_d[$priority][]=$item; } else if(isset($this->_d[$priority])) { $cc = $index; -- cgit v1.2.3