mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
fix: void copy when getting json chunk (#43183)
fix: https://github.com/milvus-io/milvus/issues/43182 Signed-off-by: SpadeA <tangchenjie1210@gmail.com>
This commit is contained in:
parent
8720feeb79
commit
d41eec6f10
@ -90,6 +90,13 @@ class Json {
|
|||||||
cap);
|
cap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WARN: this is used for fast non-copy construction,
|
||||||
|
// MUST make sure there at least SIMDJSON_PADDING bytes allocated
|
||||||
|
// after the string_view
|
||||||
|
explicit Json(const std::string_view& data)
|
||||||
|
: Json(data.data(), data.size()) {
|
||||||
|
}
|
||||||
|
|
||||||
// WARN: this is used for fast non-copy construction,
|
// WARN: this is used for fast non-copy construction,
|
||||||
// MUST make sure that the data points to a memory that
|
// MUST make sure that the data points to a memory that
|
||||||
// with size at least len + SIMDJSON_PADDING
|
// with size at least len + SIMDJSON_PADDING
|
||||||
|
|||||||
@ -196,7 +196,7 @@ class SegmentInternalInterface : public SegmentInterface {
|
|||||||
std::vector<Json> res;
|
std::vector<Json> res;
|
||||||
res.reserve(string_views.size());
|
res.reserve(string_views.size());
|
||||||
for (const auto& str_view : string_views) {
|
for (const auto& str_view : string_views) {
|
||||||
res.emplace_back(str_view);
|
res.emplace_back(Json(str_view));
|
||||||
}
|
}
|
||||||
return PinWrapper<
|
return PinWrapper<
|
||||||
std::pair<std::vector<ViewType>, FixedVector<bool>>>(
|
std::pair<std::vector<ViewType>, FixedVector<bool>>>(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user