SimpleShell: Reserve buffer before appending
authorBen Gamari <bgamari.foss@gmail.com>
Sun, 10 Feb 2013 21:55:05 +0000 (16:55 -0500)
committerBen Gamari <bgamari.foss@gmail.com>
Mon, 11 Feb 2013 00:02:21 +0000 (19:02 -0500)
src/modules/utils/simpleshell/SimpleShell.cpp

index cabd2d5..d80cfd2 100644 (file)
@@ -154,6 +154,7 @@ void SimpleShell::on_main_loop(void* argument){
     if( this->playing_file ){
         string buffer;
         int c;
+        buffer.reserve(20);
         // Print each line of the file
         while ((c = fgetc(this->current_file_handler)) != EOF){
             if (c == '\n'){