fix: parse fail in empty json (#37294)

#37200

Signed-off-by: lixinguo <xinguo.li@zilliz.com>
Co-authored-by: lixinguo <xinguo.li@zilliz.com>
pull/37215/head
smellthemoon 2024-11-03 19:00:21 +08:00 committed by GitHub
parent 50de122dc7
commit 51cb2fbf97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -133,6 +133,9 @@ class Json {
value_result<document>
doc() const {
if (data_.size() == 0) {
return {};
}
thread_local simdjson::ondemand::parser parser;
// it's always safe to add the padding,
@ -148,6 +151,9 @@ class Json {
value_result<simdjson::dom::element>
dom_doc() const {
if (data_.size() == 0) {
return {};
}
thread_local simdjson::dom::parser parser;
// it's always safe to add the padding,