Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

human_readable_duration, Terminal::appendstring: Pass strings by refe…

…rence

Found by cppcheck.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information...
commit d0eeabb51e0aa013e94c675dcdff5aa45298caf1 1 parent e2abb85
@andersk andersk authored committed
View
2  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() );
View
2  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 );
};
Please sign in to comment.
Something went wrong with that request. Please try again.