Skip to content

Commit bdac16f

Browse files
committed
fix Utils/WaitGroup add(delta)
1 parent bad1925 commit bdac16f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Utils/WaitGroup/Handlers/RevoltWaitGroup.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __destruct()
3939
/** @inheritdoc */
4040
public function add(int $delta = 1): bool
4141
{
42-
$this->_count++;
42+
$this->_count += max($delta, 1);
4343

4444
return true;
4545
}

src/Utils/WaitGroup/Handlers/RippleWaitGroup.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __destruct()
3939
/** @inheritdoc */
4040
public function add(int $delta = 1): bool
4141
{
42-
$this->_count++;
42+
$this->_count += max($delta, 1);
4343

4444
return true;
4545
}

src/Utils/WaitGroup/Handlers/SwowWaitGroup.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public function __destruct()
4343
/** @inheritdoc */
4444
public function add(int $delta = 1): bool
4545
{
46-
$this->_waitGroup->add($delta);
47-
$this->_count++;
46+
$this->_waitGroup->add($delta = max($delta, 1));
47+
$this->_count += $delta;
4848

4949
return true;
5050
}

0 commit comments

Comments
 (0)