Skip to content

Commit

Permalink
human_readable_duration, Terminal::appendstring: Pass strings by refe…
Browse files Browse the repository at this point in the history
…rence

Found by cppcheck.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk authored and keithw committed Mar 10, 2013
1 parent e2abb85 commit d0eeabb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/frontend/terminaloverlay.cc
Expand Up @@ -172,7 +172,7 @@ NotificationEngine::NotificationEngine()
show_quit_keystroke( true ) 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 ]; char tmp[ 128 ];
if ( num_seconds < 60 ) { if ( num_seconds < 60 ) {
snprintf( tmp, 128, "%d %s", num_seconds, seconds_abbr.c_str() ); snprintf( tmp, 128, "%d %s", num_seconds, seconds_abbr.c_str() );
Expand Down
2 changes: 1 addition & 1 deletion src/terminal/terminaldisplay.h
Expand Up @@ -58,7 +58,7 @@ namespace Terminal {
} }


void append( const char * s ) { str.append( s ); } 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 ); void append_silent_move( int y, int x );
}; };
Expand Down

0 comments on commit d0eeabb

Please sign in to comment.