Skip to content

Commit

Permalink
fixed issue zendframework#8 with count increment on insert
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshVee committed Jun 19, 2015
1 parent d0ebf57 commit 363408b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/PriorityList.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ class PriorityList implements Iterator, Countable
*/
public function insert($name, $value, $priority = 0)
{
if (!isset($this->items[$name])) {
$this->count++;
}

$this->sorted = false;
$this->count++;

$this->items[$name] = [
'data' => $value,
Expand Down

0 comments on commit 363408b

Please sign in to comment.