summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r--src/gui/chatwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 75ec6d09c..0229f9da5 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -845,11 +845,12 @@ void ChatWindow::keyPressed(gcn::KeyEvent &event)
ChatTab *tab = getFocused();
if (tab && tab->hasRows())
{
- if (mChatHistoryIndex + 1 < tab->getRows().size())
+ const size_t tabSize = tab->getRows().size();
+ if (mChatHistoryIndex + 1 < tabSize)
{
mChatHistoryIndex ++;
}
- else if (mChatHistoryIndex < tab->getRows().size())
+ else if (mChatHistoryIndex < tabSize)
{
mChatHistoryIndex ++;
mChatInput->setText("");