doc(miniscript): Explain why we operate on vectors
What changed, and why it matters
This commit only adds a two-line comment explaining why the code manipulates vectors of objects rather than individual objects. It changes no program logic, no data structures, and no behavior. There is no security issue here.
No action needed; this is a documentation-only change with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure documentation change in src/script/miniscript.h inside the Node destructor. It adds an explanatory comment above the existing std::vector
Changed components
src/script/miniscript.hInspect captured patch +3 / −0
diff --git a/src/script/miniscript.h b/src/script/miniscript.h
index a65900c7..4f0cf654 100644
--- a/src/script/miniscript.h
+++ b/src/script/miniscript.h
@@ -552,6 +552,9 @@ public:
// Destroy the subexpressions iteratively after moving out their
// subexpressions to avoid a stack-overflow due to recursive calls to
// the subs' destructors.
+ // We move vectors in order to only update array-pointers inside them
+ // rather than moving individual Node instances which would involve
+ // moving/copying each Node field.
std::vector<std::vector<Node>> queue;
queue.push_back(std::move(subs));
do {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.