Skip to content

Commit

Permalink
fix Utils/WaitGroup add(delta)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaz6chez committed Nov 8, 2024
1 parent bad1925 commit bdac16f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Utils/WaitGroup/Handlers/RevoltWaitGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __destruct()
/** @inheritdoc */
public function add(int $delta = 1): bool
{
$this->_count++;
$this->_count += max($delta, 1);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/WaitGroup/Handlers/RippleWaitGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __destruct()
/** @inheritdoc */
public function add(int $delta = 1): bool
{
$this->_count++;
$this->_count += max($delta, 1);

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Utils/WaitGroup/Handlers/SwowWaitGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function __destruct()
/** @inheritdoc */
public function add(int $delta = 1): bool
{
$this->_waitGroup->add($delta);
$this->_count++;
$this->_waitGroup->add($delta = max($delta, 1));
$this->_count += $delta;

return true;
}
Expand Down

0 comments on commit bdac16f

Please sign in to comment.