mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-25 19:32:03 +08:00
code_style: use ?: operator instead of if...else
This commit is contained in:
@@ -134,15 +134,7 @@ namespace SourceGit.ViewModels
|
||||
var activeIdx = Pages.IndexOf(_activePage);
|
||||
if (removeIdx == activeIdx)
|
||||
{
|
||||
if (removeIdx == Pages.Count - 1)
|
||||
{
|
||||
ActivePage = Pages[removeIdx - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
ActivePage = Pages[removeIdx + 1];
|
||||
}
|
||||
|
||||
ActivePage = Pages[removeIdx == Pages.Count - 1 ? removeIdx - 1 : removeIdx + 1];
|
||||
CloseRepositoryInTab(page);
|
||||
Pages.RemoveAt(removeIdx);
|
||||
OnPropertyChanged(nameof(Pages));
|
||||
|
||||
Reference in New Issue
Block a user