"docs/source/en/api/models/sd3_transformer2d.md" did not exist on "eadf0e2555cfa19b033e02de53553f71ac33536f"
Commit 3337df7c authored by Jesse Beder's avatar Jesse Beder
Browse files

Fixed new API node key/value insertion in NodeBuilder (it was using the wrong...

Fixed new API node key/value insertion in NodeBuilder (it was using the wrong condition on when it had added a key already)
parent 41533a8c
...@@ -86,7 +86,7 @@ namespace YAML ...@@ -86,7 +86,7 @@ namespace YAML
RegisterAnchor(anchor, node); RegisterAnchor(anchor, node);
if(needsKey) if(needsKey)
m_keys.push_back(&node); m_keys.push_back(Key(&node, false));
return node; return node;
} }
...@@ -108,10 +108,12 @@ namespace YAML ...@@ -108,10 +108,12 @@ namespace YAML
if(collection.type() == NodeType::Sequence) { if(collection.type() == NodeType::Sequence) {
collection.append(node, m_pMemory); collection.append(node, m_pMemory);
} else if(collection.type() == NodeType::Map) { } else if(collection.type() == NodeType::Map) {
detail::node& key = *m_keys.back(); Key& key = m_keys.back();
if(&key != &node) { if(key.second) {
collection.insert(*key.first, node, m_pMemory);
m_keys.pop_back(); m_keys.pop_back();
collection.insert(key, node, m_pMemory); } else {
key.second = true;
} }
} else { } else {
assert(false); assert(false);
......
...@@ -47,7 +47,8 @@ namespace YAML ...@@ -47,7 +47,8 @@ namespace YAML
Nodes m_stack; Nodes m_stack;
Nodes m_anchors; Nodes m_anchors;
Nodes m_keys; typedef std::pair<detail::node *, bool> Key;
std::vector<Key> m_keys;
std::size_t m_mapDepth; std::size_t m_mapDepth;
}; };
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment