From 070894a5977755a1aa6bfabf3670faf7efc1321a Mon Sep 17 00:00:00 2001 From: Xiaoxi Wang Date: Thu, 15 Dec 2022 12:56:49 -0800 Subject: [PATCH] return early if streams is empty --- fdbclient/BlobGranuleFiles.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fdbclient/BlobGranuleFiles.cpp b/fdbclient/BlobGranuleFiles.cpp index b0a1331d10..752f33b9e8 100644 --- a/fdbclient/BlobGranuleFiles.cpp +++ b/fdbclient/BlobGranuleFiles.cpp @@ -1338,6 +1338,10 @@ static RangeResult mergeDeltaStreams(const BlobGranuleChunkRef& chunk, ASSERT(streams.size() < std::numeric_limits::max()); ASSERT(startClears.size() == streams.size()); + if (streams.empty()) { + return RangeResult{}; + } + int prefixLen = commonPrefixLength(chunk.keyRange.begin, chunk.keyRange.end); // next element for each stream