From 5b497b5655664a214aed191587bce0b4814ae18c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 19 Mar 2014 16:30:13 -0300 Subject: Don't create then set, do both at the same time. When we create, then set the value of a variable, we are wasting cycles and making the code more verbose. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/tagwidget.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/qt-ui/tagwidget.cpp b/qt-ui/tagwidget.cpp index 821089c15..891b66425 100644 --- a/qt-ui/tagwidget.cpp +++ b/qt-ui/tagwidget.cpp @@ -145,8 +145,7 @@ void TagWidget::completionSelected(const QString& completion) void TagWidget::completionHighlighted(const QString& completion) { - QPair pos; - pos = getCursorTagPosition(); + QPair pos = getCursorTagPosition(); if (pos.first >= 0 && pos.second > 0) { setText(text().remove(pos.first, pos.second - pos.first).insert(pos.first, completion)); setCursorPosition(pos.first + completion.length()); -- cgit v1.2.3-70-g09d2