diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-20 20:50:50 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-20 20:50:50 +0300 |
commit | 4b19b15936faa8e1d5f331cc11147ccfc360bde7 (patch) | |
tree | e601b548c0c55a7e434b30cfff328ca5e3662bee /src/gui/chatwindow.cpp | |
parent | 042c4f09e34157522692d6f99f5c51bc04e8f27a (diff) | |
download | plus-4b19b15936faa8e1d5f331cc11147ccfc360bde7.tar.gz plus-4b19b15936faa8e1d5f331cc11147ccfc360bde7.tar.bz2 plus-4b19b15936faa8e1d5f331cc11147ccfc360bde7.tar.xz plus-4b19b15936faa8e1d5f331cc11147ccfc360bde7.zip |
improve a bit code speed.
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r-- | src/gui/chatwindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 33a621cfe..9fca48e7d 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -861,7 +861,8 @@ void ChatWindow::keyPressed(gcn::KeyEvent &event) const ChatTab *const tab = getFocused(); if (tab && tab->hasRows()) { - const size_t &tabSize = tab->getRows().size(); + const std::list<std::string> &rows = tab->getRows(); + const size_t &tabSize = rows.size(); if (mChatHistoryIndex + 1 < tabSize) { mChatHistoryIndex ++; @@ -880,7 +881,7 @@ void ChatWindow::keyPressed(gcn::KeyEvent &event) unsigned int f = 0; for (std::list<std::string>::const_iterator - it = tab->getRows().begin(), it_end = tab->getRows().end(); + it = rows.begin(), it_end = rows.end(); it != it_end; ++it, f++) { if (f == mChatHistoryIndex) |