From fd7c494c6bfa01a5582d60d234725c564507e9fa Mon Sep 17 00:00:00 2001 From: Hodlinator <172445034+hodlinator@users.noreply.github.com> Date: Thu, 5 Feb 2026 13:00:38 +0100 Subject: [PATCH] doc(miniscript): Explain why we operate on vectors Explains the reason behind 198bbaee4959119a63b4038cd0dbb519f4daf6f0 where we had earlier switched from operating on unique_ptr to plain Node. --- src/script/miniscript.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/script/miniscript.h b/src/script/miniscript.h index a65900c7840..4f0cf654351 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> queue; queue.push_back(std::move(subs)); do {