diff options
author | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> | 2011-05-06 19:36:16 +0300 |
---|---|---|
committer | Arjan van de Ven <arjan@linux.intel.com> | 2011-05-11 00:04:24 -0400 |
commit | 0b13635f9a6824510a6f4bdadeecf06aef616281 (patch) | |
tree | 32b2add105dedd395c34abdb071b1506e6bd673d | |
parent | 4c4b72a9fb55681261cfb5a307d9a8e45ecc4943 (diff) | |
download | powertop-0b13635f9a6824510a6f4bdadeecf06aef616281.tar.gz |
display: style: Pass const references of std::string
display: Pass const references of std::string, avoiding temporary object creation.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
-rw-r--r-- | display.cpp | 4 | ||||
-rw-r--r-- | display.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/display.cpp b/display.cpp index 0131fdc..5ca260e 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()); } @@ -62,10 +62,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 |