From 09a1875ad8cddeb17c19af34b8282d37fed0937e Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Mon, 30 Dec 2024 16:14:39 -0500 Subject: [PATCH] miniscript: Make NodeRef a unique_ptr There's no need for it to be a shared_ptr. --- src/script/miniscript.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/script/miniscript.h b/src/script/miniscript.h index fbd10ff58e1..03f0a7c3654 100644 --- a/src/script/miniscript.h +++ b/src/script/miniscript.h @@ -189,11 +189,11 @@ inline consteval Type operator""_mst(const char* c, size_t l) using Opcode = std::pair>; template struct Node; -template using NodeRef = std::shared_ptr>; +template using NodeRef = std::unique_ptr>; -//! Construct a miniscript node as a shared_ptr. +//! Construct a miniscript node as a unique_ptr. template -NodeRef MakeNodeRef(Args&&... args) { return std::make_shared>(std::forward(args)...); } +NodeRef MakeNodeRef(Args&&... args) { return std::make_unique>(std::forward(args)...); } //! The different node types in miniscript. enum class Fragment {