mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-09 03:18:09 -03:00
miniscript: Make NodeRef a unique_ptr
There's no need for it to be a shared_ptr.
This commit is contained in:
parent
3f10ee4fc4
commit
8d12b59951
1 changed files with 3 additions and 3 deletions
|
@ -184,11 +184,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 a new issue