diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Dictionary.cpp | 9 | ||||
-rw-r--r-- | src/plist.c | 7 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/Dictionary.cpp b/src/Dictionary.cpp index 6fd45e6..6009ea4 100644 --- a/src/Dictionary.cpp +++ b/src/Dictionary.cpp @@ -140,13 +140,13 @@ Dictionary::iterator Dictionary::Find(const std::string& key) return _map.find(key); } -Dictionary::iterator Dictionary::Insert(const std::string& key, Node* node) +Dictionary::iterator Dictionary::Set(const std::string& key, Node* node) { if (node) { Node* clone = node->Clone(); UpdateNodeParent(clone); - plist_dict_insert_item(_node, key.c_str(), clone->GetPlist()); + plist_dict_set_item(_node, key.c_str(), clone->GetPlist()); delete _map[key]; _map[key] = clone; return _map.find(key); @@ -154,6 +154,11 @@ Dictionary::iterator Dictionary::Insert(const std::string& key, Node* node) return iterator(this->_map.end()); } +Dictionary::iterator Dictionary::Insert(const std::string& key, Node* node) +{ + return this->Set(key, node); +} + void Dictionary::Remove(Node* node) { if (node) diff --git a/src/plist.c b/src/plist.c index f33de0a..eeb4ffd 100644 --- a/src/plist.c +++ b/src/plist.c @@ -424,12 +424,7 @@ void plist_dict_set_item(plist_t node, const char* key, plist_t item) void plist_dict_insert_item(plist_t node, const char* key, plist_t item) { - if (node && PLIST_DICT == plist_get_node_type(node)) - { - node_attach(node, plist_new_key(key)); - node_attach(node, item); - } - return; + plist_dict_set_item(node, key, item); } void plist_dict_remove_item(plist_t node, const char* key) |