mirror of
https://github.com/dlang/phobos.git
synced 2025-04-27 13:40:20 +03:00
Merge remote-tracking branch 'upstream/stable' into merge_stable
This commit is contained in:
commit
e89ca123e2
1 changed files with 10 additions and 1 deletions
|
@ -1508,7 +1508,7 @@ public:
|
|||
|
||||
if (this.size == 0)
|
||||
{
|
||||
return rangeLen;
|
||||
return max(rangeLen, 1);
|
||||
}
|
||||
|
||||
immutable size_t eightSize = 4 * (this.size + 1);
|
||||
|
@ -3644,6 +3644,15 @@ ParallelForeach!R parallel(R)(R range, size_t workUnitSize)
|
|||
assert(arrIndex.sum == 10.iota.sum);
|
||||
}
|
||||
|
||||
// https://issues.dlang.org/show_bug.cgi?id=22745
|
||||
@system unittest
|
||||
{
|
||||
auto pool = new TaskPool(0);
|
||||
int[] empty;
|
||||
foreach (i; pool.parallel(empty)) {}
|
||||
pool.finish();
|
||||
}
|
||||
|
||||
// Thrown when a parallel foreach loop is broken from.
|
||||
class ParallelForeachError : Error
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue