Fix duplicate attribute detection for lists and hashes

This commit is contained in:
Eric Fischer 2017-06-05 11:01:15 -07:00
parent c1889b74fd
commit 93005de00e
3 changed files with 8 additions and 4 deletions

View File

@ -416,7 +416,10 @@ bool mvt_value::operator<(const mvt_value &o) const {
(type == mvt_int && numeric_value.int_value < o.numeric_value.int_value) ||
(type == mvt_uint && numeric_value.uint_value < o.numeric_value.uint_value) ||
(type == mvt_sint && numeric_value.sint_value < o.numeric_value.sint_value) ||
(type == mvt_bool && numeric_value.bool_value < o.numeric_value.bool_value)) {
(type == mvt_bool && numeric_value.bool_value < o.numeric_value.bool_value) ||
(type == mvt_list && list_value < o.list_value) ||
(type == mvt_hash && list_value < o.list_value) ||
(type == mvt_null && numeric_value.int_value < o.numeric_value.int_value)) {
return true;
}
}

View File

@ -7,7 +7,8 @@
"true": true,
"false": false,
"array": [
"string", 10, null, true, false
]
"string", 10, null, true, false, [ 1, 2, 3 ], { "this": "that" }
],
"nest": { "something": "else" }
}
}, "geometry": { "type": "Point", "coordinates": [ 0,0 ]} }

View File

@ -12,7 +12,7 @@
}, "features": [
{ "type": "FeatureCollection", "properties": { "zoom": 0, "x": 0, "y": 0 }, "features": [
{ "type": "FeatureCollection", "properties": { "layer": "in", "version": 2, "extent": 4096 }, "features": [
{ "type": "Feature", "properties": { "compound": {"string":"string","number":10,"null":null,"true":true,"false":false,"array":["string",10,null,true,false]} }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
{ "type": "Feature", "properties": { "compound": {"string":"string","number":10,"null":null,"true":true,"false":false,"array":["string",10,null,true,false,[1,2,3],{"this":"that"}],"nest":{"something":"else"}} }, "geometry": { "type": "Point", "coordinates": [ 0.000000, 0.000000 ] } }
] }
] }
] }