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

Do not bother using unique pointers in the map

parent 6a4491b2
......@@ -96,15 +96,13 @@ Spline *Map<Spline>::get_spline(std::string const &which) {
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(
std::make_unique<Spline>(std::move(x), std::move(y), std::move(z))});
std::tie(it, std::ignore) = _splines.emplace(
which, Spline(std::move(x), std::move(y), std::move(z)));
return (it->second).get();
return &it->second;
template <typename Spline>
std::map<std::string, std::unique_ptr<Spline>> Map<Spline>::_splines;
template <typename Spline> std::map<std::string, Spline> Map<Spline>::_splines;
template class Map<Spline2D<Bicubic>>;
template class Map<Spline2D<Bilinear>>;
......@@ -4,7 +4,6 @@
#include <Spline2D.hpp>
#include <map>
#include <memory>
#include <string>
namespace noname {
......@@ -16,7 +15,7 @@ public:
static void clear() { _splines.clear(); }
static std::map<std::string, std::unique_ptr<Spline>> _splines;
static std::map<std::string, Spline> _splines;
} // namespace noname
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