mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
set minimum capacity to one if it's zero in Segment constructor
Allocating an empty Segment causes problems for later computations, so we avoid it even if the caller would otherwise permit it.
This commit is contained in:
parent
e5a8d5c824
commit
39cffb8933
@ -346,6 +346,10 @@ class Segment {
|
||||
map(map)
|
||||
{
|
||||
if (desired) {
|
||||
if (minimum == 0) {
|
||||
minimum = 1;
|
||||
}
|
||||
|
||||
assert(context, desired >= minimum);
|
||||
|
||||
capacity_ = desired;
|
||||
|
Loading…
Reference in New Issue
Block a user