Fix some clang tidy things

This commit is contained in:
Patricia Aas 2020-11-29 19:21:55 +01:00
parent fe03c440fb
commit fd6e33711b
3 changed files with 8 additions and 8 deletions

View file

@ -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);

View file

@ -7,6 +7,6 @@ typedef std::vector<std::string> 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);

View file

@ -3,14 +3,14 @@
#include "lcd.hpp"
#include <iostream>
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) {