Skip to content
This repository has been archived by the owner on Oct 17, 2019. It is now read-only.

Commit

Permalink
Convert 'if' to 'else if' to remove a no-op
Browse files Browse the repository at this point in the history
  • Loading branch information
mujx committed Jan 17, 2018
1 parent 9de2db2 commit 92a578f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/TextInputWidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,8 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event)
++history_index_;
setPlainText(working_history_[history_index_]);
moveCursor(QTextCursor::End);
}

// Move to the start of the text if there aren't any lines to move up to.
if (textCursor() == initial_cursor) {
} else if (textCursor() == initial_cursor) {
// Move to the start of the text if there aren't any lines to move up to.
initial_cursor.movePosition(QTextCursor::Start, QTextCursor::MoveAnchor, 1);
setTextCursor(initial_cursor);
}
Expand All @@ -111,10 +109,8 @@ FilteredTextEdit::keyPressEvent(QKeyEvent *event)
--history_index_;
setPlainText(working_history_[history_index_]);
moveCursor(QTextCursor::End);
}

// Move to the end of the text if there aren't any lines to move down to.
if (textCursor() == initial_cursor) {
} else if (textCursor() == initial_cursor) {
// Move to the end of the text if there aren't any lines to move down to.
initial_cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor, 1);
setTextCursor(initial_cursor);
}
Expand Down

0 comments on commit 92a578f

Please sign in to comment.