Skip to content

Commit 0e52728

Browse files
committed
clusterlin: rename Intersect -> IntersectPrefixes
This makes it clearer what the function does.
1 parent 9774a95 commit 0e52728

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/cluster_linearize.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,12 @@ class LinearizationChunking
333333
* of the linearization that has a feerate not below subset's.
334334
*
335335
* This is a crucial operation in guaranteeing improvements to linearizations. If subset has
336-
* a feerate not below GetChunk(0)'s, then moving Intersect(subset) to the front of (what
337-
* remains of) the linearization is guaranteed not to make it worse at any point.
336+
* a feerate not below GetChunk(0)'s, then moving IntersectPrefixes(subset) to the front of
337+
* (what remains of) the linearization is guaranteed not to make it worse at any point.
338338
*
339339
* See https://delvingbitcoin.org/t/introduction-to-cluster-linearization/1032 for background.
340340
*/
341-
SetInfo<SetType> Intersect(const SetInfo<SetType>& subset) const noexcept
341+
SetInfo<SetType> IntersectPrefixes(const SetInfo<SetType>& subset) const noexcept
342342
{
343343
Assume(subset.transactions.IsSubsetOf(m_todo));
344344
SetInfo<SetType> accumulator;
@@ -719,7 +719,7 @@ std::pair<std::vector<ClusterIndex>, bool> Linearize(const DepGraph<SetType>& de
719719
// sure we don't pick something that makes us unable to reach further diagram points
720720
// of the old linearization.
721721
if (old_chunking.NumChunksLeft() > 0) {
722-
best = old_chunking.Intersect(best);
722+
best = old_chunking.IntersectPrefixes(best);
723723
}
724724
}
725725

src/test/fuzz/cluster_linearize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,10 @@ FUZZ_TARGET(clusterlin_linearization_chunking)
560560
}
561561
assert(combined == todo);
562562

563-
// Verify the expected properties of LinearizationChunking::Intersect:
564-
auto intersect = chunking.Intersect(subset);
563+
// Verify the expected properties of LinearizationChunking::IntersectPrefixes:
564+
auto intersect = chunking.IntersectPrefixes(subset);
565565
// - Intersecting again doesn't change the result.
566-
assert(chunking.Intersect(intersect) == intersect);
566+
assert(chunking.IntersectPrefixes(intersect) == intersect);
567567
// - The intersection is topological.
568568
TestBitSet intersect_anc;
569569
for (auto idx : intersect.transactions) {

0 commit comments

Comments
 (0)