CTweakEditor: Unindent some code
@@ -63,19 +63,20 @@ void CTweakEditor::SetActiveTweakData(CTweakData* pTweakData)
{
for (int TweakIdx = 0; TweakIdx < mTweakAssets.size(); TweakIdx++)
{
- if (mTweakAssets[TweakIdx] == pTweakData)
- {
- CSetTweakIndexCommand* pCommand = new CSetTweakIndexCommand(this, mCurrentTweakIndex, TweakIdx);
+ if (mTweakAssets[TweakIdx] != pTweakData)
+ continue;
+
+ auto* pCommand = new CSetTweakIndexCommand(this, mCurrentTweakIndex, TweakIdx);
UndoStack().push(pCommand);
break;
}
}
-}
void CTweakEditor::SetActiveTweakIndex(int Index)
{
- if( mCurrentTweakIndex != Index )
- {
+ if (mCurrentTweakIndex == Index)
+ return;
+
mCurrentTweakIndex = Index;
CTweakData* pTweakData = mTweakAssets[Index];
@@ -85,16 +86,15 @@ void CTweakEditor::SetActiveTweakIndex(int Index)
mpUI->TweakTabs->setCurrentIndex(Index);
mpUI->TweakTabs->blockSignals(false);
}
-}
void CTweakEditor::OnTweakTabClicked(int Index)
{
- if (Index != mCurrentTweakIndex)
- {
- CSetTweakIndexCommand* pCommand = new CSetTweakIndexCommand(this, mCurrentTweakIndex, Index);
+ if (Index == mCurrentTweakIndex)
+ return;
+
+ auto* pCommand = new CSetTweakIndexCommand(this, mCurrentTweakIndex, Index);
UndoStack().push(pCommand);
}
-}
void CTweakEditor::OnProjectChanged(CGameProject* pNewProject)
{
