From fd6e33711b1ba26e072c940238ee4d6a62c1c01c Mon Sep 17 00:00:00 2001 From: Patricia Aas Date: Sun, 29 Nov 2020 19:21:55 +0100 Subject: [PATCH] Fix some clang tidy things --- lcd/lib/lcd.cpp | 6 +++--- lcd/lib/lcd.hpp | 6 +++--- lcd/test/lcd_tests.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lcd/lib/lcd.cpp b/lcd/lib/lcd.cpp index f17caea..65878b2 100644 --- a/lcd/lib/lcd.cpp +++ b/lcd/lib/lcd.cpp @@ -1,8 +1,8 @@ #include "lcd.hpp" -lcd_grid lcd(std::string s1, - std::string s2, - std::string s3) { +lcd_grid lcd(const std::string & s1, + const std::string & s2, + const std::string & s3) { lcd_grid result; result.push_back(s1); result.push_back(s2); diff --git a/lcd/lib/lcd.hpp b/lcd/lib/lcd.hpp index 6bccce9..974d919 100644 --- a/lcd/lib/lcd.hpp +++ b/lcd/lib/lcd.hpp @@ -7,6 +7,6 @@ typedef std::vector lcd_grid; lcd_grid lcd(int value); -lcd_grid lcd(std::string s1, - std::string s2, - std::string s3); +lcd_grid lcd(const std::string & s1, + const std::string & s2, + const std::string & s3); diff --git a/lcd/test/lcd_tests.cpp b/lcd/test/lcd_tests.cpp index f173d61..a5c7a8e 100644 --- a/lcd/test/lcd_tests.cpp +++ b/lcd/test/lcd_tests.cpp @@ -3,14 +3,14 @@ #include "lcd.hpp" #include -std::string to_string(lcd_grid grid) { +std::string to_string(const lcd_grid & grid) { std::stringstream output; for (const auto & str: grid) output << str; return output.str(); } -void lcd_spec(int value, lcd_grid grid) { +void lcd_spec(int value, const lcd_grid & grid) { std::string expected = to_string(grid), actual = to_string(lcd(value)); if (expected != actual) {