doc(miniscript): Remove mention of shared pointers
What changed, and why it matters
This is a documentation-only change. A comment above a destructor was rewritten to no longer mention 'shared pointers' and was moved inside the function body. The actual code logic of the destructor did not change at all.
No action needed. This is a non-functional documentation cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies only comments in src/script/miniscript.h. The Node destructor’s implementation remains identical: it still iteratively moves and pops child nodes from the subs vector to prevent stack overflow from recursive destruction. The only change is that the explanatory comment was reworded and relocated into the function body for consistency with the nearby Clone() function.
Changed components
src/script/miniscript.hInspect captured patch +5 / −3
diff --git a/src/script/miniscript.h b/src/script/miniscript.h
index 74600292..a1ca3eaa 100644
--- a/src/script/miniscript.h
+++ b/src/script/miniscript.h
@@ -532,9 +532,11 @@ struct Node {
//! The Script context for this node. Either P2WSH or Tapscript.
const MiniscriptContext m_script_ctx;
- /* Destroy the shared pointers iteratively to avoid a stack-overflow due to recursive calls
- * to the subs' destructors. */
- ~Node() {
+ ~Node()
+ {
+ // Destroy the subexpressions iteratively after moving out their
+ // subexpressions to avoid a stack-overflow due to recursive calls to
+ // the subs' destructors.
while (!subs.empty()) {
auto node = std::move(subs.back());
subs.pop_back();
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.