diff --git a/userspace/libsinsp/utils.cpp b/userspace/libsinsp/utils.cpp index 4ed6a87a19..05b38272b5 100644 --- a/userspace/libsinsp/utils.cpp +++ b/userspace/libsinsp/utils.cpp @@ -1264,13 +1264,13 @@ std::vector sinsp_split(std::string_view sv, char delim) { std::string_view::size_type start = 0; for(std::string_view::size_type i = 0; i < sv.size(); i++) { if(sv[i] == delim) { - res.push_back(std::string(sv.substr(start, i - start))); + res.emplace_back(sv.substr(start, i - start)); start = i + 1; } } if(start <= sv.length()) { - res.push_back(std::string(sv.substr(start))); + res.emplace_back(sv.substr(start)); } return res;