Fix kostya<yyjson> issue
This commit is contained in:
parent
680cd6df34
commit
065ea00066
|
@ -9,7 +9,7 @@ namespace kostya {
|
||||||
class yyjson {
|
class yyjson {
|
||||||
simdjson_really_inline double get_double(yyjson_val *obj, std::string_view key) {
|
simdjson_really_inline double get_double(yyjson_val *obj, std::string_view key) {
|
||||||
yyjson_val *val = yyjson_obj_getn(obj, key.data(), key.length());
|
yyjson_val *val = yyjson_obj_getn(obj, key.data(), key.length());
|
||||||
if (!val){ throw "missing point field!"; }
|
if (!val) { throw "missing point field!"; }
|
||||||
if (yyjson_get_type(val) != YYJSON_TYPE_NUM) { throw "Number is not a type!"; }
|
if (yyjson_get_type(val) != YYJSON_TYPE_NUM) { throw "Number is not a type!"; }
|
||||||
|
|
||||||
switch (yyjson_get_subtype(val)) {
|
switch (yyjson_get_subtype(val)) {
|
||||||
|
@ -31,7 +31,7 @@ public:
|
||||||
yyjson_val *root = yyjson_doc_get_root(doc);
|
yyjson_val *root = yyjson_doc_get_root(doc);
|
||||||
if (!yyjson_is_obj(root)) { return false; }
|
if (!yyjson_is_obj(root)) { return false; }
|
||||||
yyjson_val *coords = yyjson_obj_get(root, "coordinates");
|
yyjson_val *coords = yyjson_obj_get(root, "coordinates");
|
||||||
if (!yyjson_is_obj(coords)) { return false; }
|
if (!yyjson_is_arr(coords)) { return false; }
|
||||||
|
|
||||||
size_t idx, max;
|
size_t idx, max;
|
||||||
yyjson_val *coord;
|
yyjson_val *coord;
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace large_random {
|
||||||
class yyjson {
|
class yyjson {
|
||||||
simdjson_really_inline double get_double(yyjson_val *obj, std::string_view key) {
|
simdjson_really_inline double get_double(yyjson_val *obj, std::string_view key) {
|
||||||
yyjson_val *val = yyjson_obj_getn(obj, key.data(), key.length());
|
yyjson_val *val = yyjson_obj_getn(obj, key.data(), key.length());
|
||||||
if (!val){ throw "missing point field!"; }
|
if (!val) { throw "missing point field!"; }
|
||||||
if (yyjson_get_type(val) != YYJSON_TYPE_NUM) { throw "Number is not a type!"; }
|
if (yyjson_get_type(val) != YYJSON_TYPE_NUM) { throw "Number is not a type!"; }
|
||||||
|
|
||||||
switch (yyjson_get_subtype(val)) {
|
switch (yyjson_get_subtype(val)) {
|
||||||
|
|
Loading…
Reference in New Issue