mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-05-01 23:31:03 +02:00
Reordered unpack selector sequence.
This commit is contained in:
parent
7822bc787d
commit
b5b459cfca
@ -333,29 +333,7 @@ public:
|
||||
unpack_int8(*reinterpret_cast<const int8_t*>(m_current), obj);
|
||||
int ret = push_proc(obj, off);
|
||||
if (ret != 0) return ret;
|
||||
} else if(0xc0 <= selector && selector <= 0xc3) { // nil, bool
|
||||
switch(selector) {
|
||||
case 0xc0: { // nil
|
||||
unpack_nil(obj);
|
||||
int ret = push_proc(obj, off);
|
||||
if (ret != 0) return ret;
|
||||
} break;
|
||||
|
||||
//case 0xc1: // string
|
||||
case 0xc2: { // false
|
||||
unpack_false(obj);
|
||||
int ret = push_proc(obj, off);
|
||||
if (ret != 0) return ret;
|
||||
} break;
|
||||
|
||||
case 0xc3: { // true
|
||||
unpack_true(obj);
|
||||
int ret = push_proc(obj, off);
|
||||
if (ret != 0) return ret;
|
||||
} break;
|
||||
}
|
||||
}
|
||||
else if (0xc4 <= selector && selector <= 0xdf) {
|
||||
} else if (0xc4 <= selector && selector <= 0xdf) {
|
||||
const uint32_t trail[] = {
|
||||
1, // bin 8 0xc4
|
||||
2, // bin 16 0xc5
|
||||
@ -409,6 +387,18 @@ public:
|
||||
int ret = push_aggregate<fix_tag>(
|
||||
unpack_map(), CT_MAP_KEY, obj, m_current, off);
|
||||
if (ret != 0) return ret;
|
||||
} else if(selector == 0xc2) { // false
|
||||
unpack_false(obj);
|
||||
int ret = push_proc(obj, off);
|
||||
if (ret != 0) return ret;
|
||||
} else if(selector == 0xc3) { // true
|
||||
unpack_true(obj);
|
||||
int ret = push_proc(obj, off);
|
||||
if (ret != 0) return ret;
|
||||
} else if(selector == 0xc0) { // nil
|
||||
unpack_nil(obj);
|
||||
int ret = push_proc(obj, off);
|
||||
if (ret != 0) return ret;
|
||||
} else {
|
||||
off = m_current - m_start;
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user