mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
Merge branch 'master' of frsyuki@git.sourceforge.jp:/gitroot/msgpack/msgpack
This commit is contained in:
commit
2598d98922
2 changed files with 6 additions and 5 deletions
|
|
@ -80,13 +80,13 @@ inline std::map<K, V> operator>> (object o, std::map<K, V>& v)
|
|||
for(; p != pend; ++p) {
|
||||
K key;
|
||||
p->key.convert(&key);
|
||||
typename std::map<K,V>::iterator it(v.find(key));
|
||||
if(it != v.end()) {
|
||||
typename std::map<K,V>::iterator it(v.lower_bound(key));
|
||||
if(it != v.end() && !(key < it->first)) {
|
||||
p->val.convert(&it->second);
|
||||
} else {
|
||||
V val;
|
||||
p->val.convert(&val);
|
||||
it->insert( std::pair<K,V>(key, val) );
|
||||
} else {
|
||||
p->val.convert(&it->second);
|
||||
v.insert(it, std::pair<K,V>(key, val));
|
||||
}
|
||||
}
|
||||
return v;
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ class MessagePackTestFormat < Test::Unit::TestCase
|
|||
|
||||
def match(obj, buf)
|
||||
assert_equal(obj.to_msgpack, buf)
|
||||
assert_equal(MessagePack::unpack(buf), obj)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue