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 4, 2015
1 parent cc8e90a commit a7db974
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/PriorityList.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +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] = array(
'data' => $value,
'priority' => (int) $priority,
Expand Down

0 comments on commit a7db974

Please sign in to comment.