Skip to content

Commit 5743350

Browse files
committed
CountDistinctClusters: nullptrs disallowed
1 parent 8bca0d3 commit 5743350

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/txgraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1880,7 +1880,7 @@ TxGraph::GraphIndex TxGraphImpl::CountDistinctClusters(std::span<const Ref* cons
18801880
std::vector<Cluster*> clusters;
18811881
clusters.reserve(refs.size());
18821882
for (const Ref* ref : refs) {
1883-
if (ref == nullptr) continue;
1883+
Assume(ref);
18841884
if (GetRefGraph(*ref) == nullptr) continue;
18851885
Assume(GetRefGraph(*ref) == this);
18861886
auto cluster = FindCluster(GetRefIndex(*ref), level);

src/txgraph.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ class TxGraph
159159
virtual std::strong_ordering CompareMainOrder(const Ref& a, const Ref& b) noexcept = 0;
160160
/** Count the number of distinct clusters that the specified transactions belong to. If
161161
* main_only is false and a staging graph exists, staging clusters are counted. Otherwise,
162-
* main clusters are counted. Refs that do not exist in the queried graph are ignored. The
163-
* queried graph must not be oversized. */
162+
* main clusters are counted. Refs that do not exist in the queried graph are ignored. Refs
163+
* can not be null. The queried graph must not be oversized. */
164164
virtual GraphIndex CountDistinctClusters(std::span<const Ref* const>, bool main_only = false) noexcept = 0;
165165

166166
/** Perform an internal consistency check on this object. */

0 commit comments

Comments
 (0)