From d0eeabb51e0aa013e94c675dcdff5aa45298caf1 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 18 Feb 2013 02:07:11 -0500 Subject: [PATCH] human_readable_duration, Terminal::appendstring: Pass strings by reference Found by cppcheck. Signed-off-by: Anders Kaseorg --- src/frontend/terminaloverlay.cc | 2 +- src/terminal/terminaldisplay.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/terminaloverlay.cc b/src/frontend/terminaloverlay.cc index c7e0f5e4c..cd28f504f 100644 --- a/src/frontend/terminaloverlay.cc +++ b/src/frontend/terminaloverlay.cc @@ -172,7 +172,7 @@ NotificationEngine::NotificationEngine() show_quit_keystroke( true ) {} -static std::string human_readable_duration( int num_seconds, const std::string seconds_abbr ) { +static std::string human_readable_duration( int num_seconds, const std::string &seconds_abbr ) { char tmp[ 128 ]; if ( num_seconds < 60 ) { snprintf( tmp, 128, "%d %s", num_seconds, seconds_abbr.c_str() ); diff --git a/src/terminal/terminaldisplay.h b/src/terminal/terminaldisplay.h index acd0fc4d1..028f62e5b 100644 --- a/src/terminal/terminaldisplay.h +++ b/src/terminal/terminaldisplay.h @@ -58,7 +58,7 @@ namespace Terminal { } void append( const char * s ) { str.append( s ); } - void appendstring( const std::string s ) { str.append( s ); } + void appendstring( const std::string &s ) { str.append( s ); } void append_silent_move( int y, int x ); };