SERVER-113374 Add check for empty container to guide Coverity (#44344)

GitOrigin-RevId: e52a5a2c9e0aee02fb063ce580e0075e30354096
This commit is contained in:
henrikedin 2025-11-25 09:39:09 -05:00 committed by MongoDB Bot
parent 124919a10f
commit 58b3064214
1 changed files with 3 additions and 0 deletions

View File

@ -356,6 +356,9 @@ template <typename T>
const OverflowPoint<T>& OverflowState<T>::detect(const ControlBlockContainer& controls) {
using namespace bsoncolumn::internal;
// This function must be called with at least one control block
invariant(!controls.empty());
// Setup reverse iteration.
auto begin = controls.rbegin();
auto it = begin;