From 065ea000660192431e4accd1ed37ca7e728f2511 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Mon, 4 Jan 2021 15:32:03 -0800 Subject: [PATCH] Fix kostya issue --- benchmark/kostya/yyjson.h | 4 ++-- benchmark/large_random/yyjson.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/kostya/yyjson.h b/benchmark/kostya/yyjson.h index 5a5c67009..c3765d1c4 100644 --- a/benchmark/kostya/yyjson.h +++ b/benchmark/kostya/yyjson.h @@ -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; diff --git a/benchmark/large_random/yyjson.h b/benchmark/large_random/yyjson.h index 7e23a2209..2ac6ce3d3 100644 --- a/benchmark/large_random/yyjson.h +++ b/benchmark/large_random/yyjson.h @@ -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)) {