Skip to content
Snippets Groups Projects
Commit c62abd76 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Scale, Coord pass string and vector args the normal way (#963)

parent f65dce94
No related branches found
No related tags found
1 merge request!2570use std::move only in special situations; normally pass arg as const ref (#963)
...@@ -38,9 +38,9 @@ std::pair<std::string, std::string> parse_label(const std::string& label) ...@@ -38,9 +38,9 @@ std::pair<std::string, std::string> parse_label(const std::string& label)
} // namespace } // namespace
Coordinate::Coordinate(std::string name, std::string unit) Coordinate::Coordinate(const std::string& name, const std::string& unit)
: m_name(std::move(name)) : m_name(name)
, m_unit(std::move(unit)) , m_unit(unit)
{ {
} }
......
...@@ -26,7 +26,7 @@ public: ...@@ -26,7 +26,7 @@ public:
{ {
} }
Coordinate(const std::string& label); Coordinate(const std::string& label);
Coordinate(std::string name, std::string unit); Coordinate(const std::string& name, const std::string& unit);
bool operator==(const Coordinate& other) const = default; bool operator==(const Coordinate& other) const = default;
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
using std::numbers::pi; using std::numbers::pi;
Scale::Scale(const Coordinate& coord, std::vector<Bin1D> bins) Scale::Scale(const Coordinate& coord, const std::vector<Bin1D>& bins)
: m_bins(std::move(bins)) : m_bins(bins)
, m_coord(std::make_unique<Coordinate>(coord)) , m_coord(std::make_unique<Coordinate>(coord))
{ {
if (size() == 0) if (size() == 0)
......
...@@ -29,7 +29,7 @@ using trafo_t = std::function<double(double)>; ...@@ -29,7 +29,7 @@ using trafo_t = std::function<double(double)>;
class Scale { class Scale {
public: public:
Scale(const Coordinate& coord, std::vector<Bin1D> bins); Scale(const Coordinate& coord, const std::vector<Bin1D>& bins);
Scale(const Scale& other); Scale(const Scale& other);
Scale* clone() const; Scale* clone() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment