Commit af4fcb80 authored by Damien L-G's avatar Damien L-G

Use move semantics when passing the arrays to make_unique

parent 82d8a370
......@@ -93,11 +93,12 @@ Spline *Map<Spline>::get_spline(std::string const &which) {
std::fstream fs(filename);
return parse(fs);
};
auto const x = extract_from(filenames[0], parse_x);
auto const y = extract_from(filenames[1], parse_y);
auto const z = extract_from(filenames[2], parse_z);
std::tie(it, std::ignore) =
_splines.insert({which, std::make_unique<Spline>(x, y, z)});
auto x = extract_from(filenames[0], parse_x);
auto y = extract_from(filenames[1], parse_y);
auto z = extract_from(filenames[2], parse_z);
std::tie(it, std::ignore) = _splines.insert(
{which,
std::make_unique<Spline>(std::move(x), std::move(y), std::move(z))});
}
return (it->second).get();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment