Fix kostya<yyjson> issue

This commit is contained in:
John Keiser 2021-01-04 15:32:03 -08:00
parent 680cd6df34
commit 065ea00066
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ namespace kostya {
class yyjson {
simdjson_really_inline double get_double(yyjson_val *obj, std::string_view key) {
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!"; }
switch (yyjson_get_subtype(val)) {
@ -31,7 +31,7 @@ public:
yyjson_val *root = yyjson_doc_get_root(doc);
if (!yyjson_is_obj(root)) { return false; }
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;
yyjson_val *coord;

View File

@ -9,7 +9,7 @@ namespace large_random {
class yyjson {
simdjson_really_inline double get_double(yyjson_val *obj, std::string_view key) {
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!"; }
switch (yyjson_get_subtype(val)) {