mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 23:07:59 +01: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
1 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Reference in a new issue