diff --git a/include/simdjson/dom/array-inl.h b/include/simdjson/dom/array-inl.h index 203478083..5f8654725 100644 --- a/include/simdjson/dom/array-inl.h +++ b/include/simdjson/dom/array-inl.h @@ -186,7 +186,7 @@ array::at_path_with_wildcard(std::string_view json_path) const noexcept { return std::vector{}; } - return std::vector{result.value()}; + return std::vector{std::move(result.value())}; } inline simdjson_result @@ -217,7 +217,7 @@ inline simdjson_result> array::get_values() const noexcept std::vector result = {}; for (auto element : *this) { - result.push_back(element); + result.emplace_back(element); } return result; diff --git a/include/simdjson/dom/object-inl.h b/include/simdjson/dom/object-inl.h index 27701b8a4..ce271d204 100644 --- a/include/simdjson/dom/object-inl.h +++ b/include/simdjson/dom/object-inl.h @@ -308,7 +308,7 @@ object::at_path_with_wildcard(std::string_view json_path) const noexcept { // JSON_PATH } } else { - std::vector result{this->at_path(json_path).value()}; + std::vector result{std::move(this->at_path(json_path).value())}; return result; }