display: Pass const references of std::string, avoiding temporary object creation.
Signed-off-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> --- diff --git a/display.cpp b/display.cpp index 284ee8a..54b072d 100644 --- a/display.cpp +++ b/display.cpp @@ -43,7 +43,7 @@ map<string, string> tab_translations; map<string, string> bottom_lines; -void create_tab(string name, string translation, class tab_window *w, string bottom_line) +void create_tab(const string &name, const string &translation, class tab_window *w, string bottom_line) { if (!w) w = new(class tab_window); @@ -180,7 +180,7 @@ WINDOW *get_ncurses_win(int nr) return win; } -WINDOW *get_ncurses_win(string name) +WINDOW *get_ncurses_win(const string &name) { return get_ncurses_win(name.c_str()); } diff --git a/display.h b/display.h index b66d043..3d9dbba 100644 --- a/display.h +++ b/display.h @@ -64,10 +64,10 @@ public: extern map<string, class tab_window *> tab_windows; WINDOW *get_ncurses_win(const char *name); -WINDOW *get_ncurses_win(string name); +WINDOW *get_ncurses_win(const string &name); WINDOW *get_ncurses_win(int nr); -void create_tab(string name, string translation, class tab_window *w = NULL, string bottom_line = ""); +void create_tab(const string &name, const string &translation, class tab_window *w = NULL, string bottom_line = ""); #endif _______________________________________________ Discuss mailing list Discuss@lesswatts.org http://lists.lesswatts.org/listinfo/discuss