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>
This commit is contained in:
Andre Hartmann
2018-10-12 19:36:26 +02:00
committed by Orgad Shaneh
parent 17fa69eb42
commit 81a4c1d934

View File

@@ -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;