diff --git a/src/color.cc b/src/color.cc index aa1980d9..54e48002 100644 --- a/src/color.cc +++ b/src/color.cc @@ -30,7 +30,7 @@ Color str_to_color(const String& color) return Colors::Default; } -String color_to_str(const Color& color) +String color_to_str(Color color) { switch (color.color) { @@ -54,7 +54,7 @@ String color_to_str(const Color& color) return "default"; } -String option_to_string(const Color& color) +String option_to_string(Color color) { return color_to_str(color); } diff --git a/src/color.hh b/src/color.hh index 9cc5abf5..16e6b678 100644 --- a/src/color.hh +++ b/src/color.hh @@ -34,21 +34,20 @@ struct Color Color(unsigned char r, unsigned char g, unsigned char b) : color{Colors::RGB}, r{r}, g{g}, b{b} {} - bool operator==(const Color& c) const + bool operator==(Color c) const { return color == c.color and r == c.r and g == c.g and b == c.b; } - bool operator!=(const Color& c) const + bool operator!=(Color c) const { return color != c.color or r != c.r or g != c.g or b != c.b; } }; using ColorPair = std::pair; Color str_to_color(const String& color); -String color_to_str(const Color& color); +String color_to_str(Color color); -String option_to_string(const Color& color); +String option_to_string(Color color); void option_from_string(const String& str, Color& color); } #endif // color_hh_INCLUDED - diff --git a/src/ncurses.cc b/src/ncurses.cc index 25d137ba..0f084da0 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -29,7 +29,7 @@ static void set_attribute(int attribute, bool on) attroff(attribute); } -static bool operator<(const Color& lhs, const Color& rhs) +static bool operator<(Color lhs, Color rhs) { if (lhs.color == rhs.color and lhs.color == Colors::RGB) return lhs.r == rhs.r ? (lhs.g == rhs.g ? lhs.b < rhs.b @@ -38,7 +38,7 @@ static bool operator<(const Color& lhs, const Color& rhs) return lhs.color < rhs.color; } -static int nc_color(const Color& color) +static int nc_color(Color color) { static std::map colors = { { Colors::Default, -1 }, @@ -99,7 +99,7 @@ static int nc_color(const Color& color) } } -static int get_color_pair(const ColorPair& colors) +static int get_color_pair(ColorPair colors) { static std::map colorpairs; static int next_pair = 1; @@ -115,7 +115,7 @@ static int get_color_pair(const ColorPair& colors) } } -static void set_color(WINDOW* window, const ColorPair colors) +static void set_color(WINDOW* window, ColorPair colors) { static int current_pair = -1; diff --git a/src/remote.cc b/src/remote.cc index f9a22988..5fe996d6 100644 --- a/src/remote.cc +++ b/src/remote.cc @@ -75,7 +75,7 @@ public: write(memoryview(vec)); } - void write(const Color& color) + void write(Color color) { write(color.color); if (color.color == Colors::RGB) @@ -86,7 +86,7 @@ public: } } - void write(const ColorPair& colors) + void write(ColorPair colors) { write(colors.first); write(colors.second);