mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 04:52:36 +02:00
miniscript: Make NodeRef a unique_ptr
There's no need for it to be a shared_ptr.
This commit is contained in:
parent
9ccb46f91a
commit
09a1875ad8
@ -189,11 +189,11 @@ inline consteval Type operator""_mst(const char* c, size_t l)
|
||||
using Opcode = std::pair<opcodetype, std::vector<unsigned char>>;
|
||||
|
||||
template<typename Key> struct Node;
|
||||
template<typename Key> using NodeRef = std::shared_ptr<const Node<Key>>;
|
||||
template<typename Key> using NodeRef = std::unique_ptr<const Node<Key>>;
|
||||
|
||||
//! Construct a miniscript node as a shared_ptr.
|
||||
//! Construct a miniscript node as a unique_ptr.
|
||||
template<typename Key, typename... Args>
|
||||
NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_shared<const Node<Key>>(std::forward<Args>(args)...); }
|
||||
NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
|
||||
|
||||
//! The different node types in miniscript.
|
||||
enum class Fragment {
|
||||
|
Loading…
Reference in New Issue
Block a user