From 4b19b15936faa8e1d5f331cc11147ccfc360bde7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 20 Sep 2013 20:50:50 +0300 Subject: improve a bit code speed. --- src/gui/chatwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui/chatwindow.cpp') 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 &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::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) -- cgit v1.2.3-60-g2f50