From 0e52728a2d6ccafcfecfefbb5a0432a9881d8e0d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 30 Jul 2024 16:21:51 -0400 Subject: [PATCH] clusterlin: rename Intersect -> IntersectPrefixes This makes it clearer what the function does. --- src/cluster_linearize.h | 8 ++++---- src/test/fuzz/cluster_linearize.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cluster_linearize.h b/src/cluster_linearize.h index 07d28a9aa5..61b76968cf 100644 --- a/src/cluster_linearize.h +++ b/src/cluster_linearize.h @@ -333,12 +333,12 @@ public: * of the linearization that has a feerate not below subset's. * * This is a crucial operation in guaranteeing improvements to linearizations. If subset has - * a feerate not below GetChunk(0)'s, then moving Intersect(subset) to the front of (what - * remains of) the linearization is guaranteed not to make it worse at any point. + * a feerate not below GetChunk(0)'s, then moving IntersectPrefixes(subset) to the front of + * (what remains of) the linearization is guaranteed not to make it worse at any point. * * See https://delvingbitcoin.org/t/introduction-to-cluster-linearization/1032 for background. */ - SetInfo Intersect(const SetInfo& subset) const noexcept + SetInfo IntersectPrefixes(const SetInfo& subset) const noexcept { Assume(subset.transactions.IsSubsetOf(m_todo)); SetInfo accumulator; @@ -719,7 +719,7 @@ std::pair, bool> Linearize(const DepGraph& de // sure we don't pick something that makes us unable to reach further diagram points // of the old linearization. if (old_chunking.NumChunksLeft() > 0) { - best = old_chunking.Intersect(best); + best = old_chunking.IntersectPrefixes(best); } } diff --git a/src/test/fuzz/cluster_linearize.cpp b/src/test/fuzz/cluster_linearize.cpp index 031cb04559..c97d00dea1 100644 --- a/src/test/fuzz/cluster_linearize.cpp +++ b/src/test/fuzz/cluster_linearize.cpp @@ -560,10 +560,10 @@ FUZZ_TARGET(clusterlin_linearization_chunking) } assert(combined == todo); - // Verify the expected properties of LinearizationChunking::Intersect: - auto intersect = chunking.Intersect(subset); + // Verify the expected properties of LinearizationChunking::IntersectPrefixes: + auto intersect = chunking.IntersectPrefixes(subset); // - Intersecting again doesn't change the result. - assert(chunking.Intersect(intersect) == intersect); + assert(chunking.IntersectPrefixes(intersect) == intersect); // - The intersection is topological. TestBitSet intersect_anc; for (auto idx : intersect.transactions) {