summaryrefslogtreecommitdiff
path: root/src/plugins/git
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2018-10-12 19:36:26 +0200
committerOrgad Shaneh <orgads@gmail.com>2018-10-13 16:34:22 +0000
commit81a4c1d934f649a892c5f1a56a85c1441ee0c7ee (patch)
tree175756e5e5e50269969d453d1506affad4c4ea95 /src/plugins/git
parent17fa69eb4268efd63aeeb40bd11da959192f3d1c (diff)
downloadqt-creator-81a4c1d934f649a892c5f1a56a85c1441ee0c7ee.tar.gz
Git: Simplify conditions in BranchView
index.isValid() is already checked in line 165, so it does not need to be checked afterwards because it is always true there. isLeaf is only used once, so join the assignment. Change-Id: I5f21486fd440b82d8e99be1248adf023da664c1e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/git')
-rw-r--r--src/plugins/git/branchview.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp
index 4619a21e7e..11cbfcdbcf 100644
--- a/src/plugins/git/branchview.cpp
+++ b/src/plugins/git/branchview.cpp
@@ -166,12 +166,10 @@ void BranchView::slotCustomContextMenu(const QPoint &point)
return;
const QModelIndex currentBranch = m_model->currentBranch();
- const bool hasSelection = index.isValid();
- const bool currentSelected = hasSelection && index == currentBranch;
+ const bool currentSelected = index == currentBranch;
const bool isLocal = m_model->isLocal(index);
- const bool isLeaf = m_model->isLeaf(index);
const bool isTag = m_model->isTag(index);
- const bool hasActions = hasSelection && isLeaf;
+ const bool hasActions = m_model->isLeaf(index);
const bool currentLocal = m_model->isLocal(currentBranch);
QMenu contextMenu;