From 22e4115312b929502574ba3681ee2c3b3fd14d96 Mon Sep 17 00:00:00 2001 From: Hodlinator <172445034+hodlinator@users.noreply.github.com> Date: Wed, 22 Jan 2025 21:19:24 +0100 Subject: [PATCH] doc(miniscript): Remove mention of shared pointers Correct destructor implementation comment to no longer refer to shared pointers and also move it into the function body, in symmetry with Clone() right below. Leftover from #30866. --- src/script/miniscript.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/script/miniscript.h b/src/script/miniscript.h index 74600292b01..a1ca3eaa32a 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();