mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Switched the implementation of maps from list<pair> to map (but just pointer comparison)
This commit is contained in:
@@ -54,7 +54,7 @@ namespace YAML
|
||||
|
||||
node& k = convert_to_node(key, pMemory);
|
||||
node& v = pMemory->create_node();
|
||||
m_map.push_back(kv_pair(&k, &v));
|
||||
m_map[&k] = &v;
|
||||
return v;
|
||||
}
|
||||
|
||||
|
@@ -86,8 +86,7 @@ namespace YAML
|
||||
mutable std::size_t m_seqSize;
|
||||
|
||||
// map
|
||||
typedef std::pair<node *, node *> kv_pair;
|
||||
typedef std::list<kv_pair> node_map;
|
||||
typedef std::map<node *, node *> node_map;
|
||||
node_map m_map;
|
||||
};
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#include "yaml-cpp/node/ptr.h"
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@@ -35,8 +35,7 @@ namespace YAML
|
||||
};
|
||||
|
||||
typedef std::vector<node *> node_seq;
|
||||
typedef std::pair<node *, node *> kv_pair;
|
||||
typedef std::list<kv_pair> node_map;
|
||||
typedef std::map<node *, node *> node_map;
|
||||
|
||||
template<typename V>
|
||||
struct node_iterator_type {
|
||||
|
Reference in New Issue
Block a user