| 319 | } |
| 320 | |
| 321 | namespace { |
| 322 | |
| 323 | int64_t require_smallest_fitting_capacity( |
| 324 | const std::vector<int64_t> & capacities, |
| 325 | int64_t request_size) { |
| 326 | if (request_size <= 0) { |
| 327 | throw std::runtime_error("graph capacity request size must be positive"); |
| 328 | } |
| 329 | if (capacities.empty()) { |
| 330 | throw std::runtime_error("graph capacity list must not be empty"); |
| 331 | } |
| 332 | auto it = std::lower_bound(capacities.begin(), capacities.end(), request_size); |
no test coverage detected