Skip to content

Commit 2c5cf98

Browse files
committed
TxGraphImpl::PullIn: only allowed when staging exists
1 parent 3358b1d commit 2c5cf98

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/txgraph.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ class TxGraphImpl final : public TxGraph
411411
* values for remaining Entry objects, so this only does something when no to-be-applied
412412
* operations or staged removals referring to GraphIndexes remain). */
413413
void Compact() noexcept;
414-
/** If cluster is not in staging, copy it there, and return a pointer to it. This has no
415-
* effect if only a main graph exists, but if staging exists this modifies the locators of its
414+
/** If cluster is not in staging, copy it there, and return a pointer to it.
415+
* Staging must exist, and this modifies the locators of its
416416
* transactions from inherited (P,M) to explicit (P,P). */
417417
Cluster* PullIn(Cluster* cluster) noexcept;
418418
/** Apply all removals queued up in m_to_remove to the relevant Clusters (which get a
@@ -928,7 +928,7 @@ Cluster* TxGraphImpl::FindCluster(GraphIndex idx, int level) const noexcept
928928
Cluster* TxGraphImpl::PullIn(Cluster* cluster) noexcept
929929
{
930930
int to_level = GetTopLevel();
931-
if (to_level == 0) return cluster;
931+
Assume(to_level == 1);
932932
int level = cluster->m_level;
933933
Assume(level <= to_level);
934934
// Copy the Cluster from main to staging, if it's not already there.

0 commit comments

Comments
 (0)