From 81a4c1d934f649a892c5f1a56a85c1441ee0c7ee Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Fri, 12 Oct 2018 19:36:26 +0200 Subject: 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 --- src/plugins/git/branchview.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/plugins/git') 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; -- cgit v1.2.1