mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
code_style: use ?:
operator instead of if...else
This commit is contained in:
parent
4af8cc18d2
commit
15456f0dee
1 changed files with 1 additions and 9 deletions
|
@ -134,15 +134,7 @@ namespace SourceGit.ViewModels
|
||||||
var activeIdx = Pages.IndexOf(_activePage);
|
var activeIdx = Pages.IndexOf(_activePage);
|
||||||
if (removeIdx == activeIdx)
|
if (removeIdx == activeIdx)
|
||||||
{
|
{
|
||||||
if (removeIdx == Pages.Count - 1)
|
ActivePage = Pages[removeIdx == Pages.Count - 1 ? removeIdx - 1 : removeIdx + 1];
|
||||||
{
|
|
||||||
ActivePage = Pages[removeIdx - 1];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ActivePage = Pages[removeIdx + 1];
|
|
||||||
}
|
|
||||||
|
|
||||||
CloseRepositoryInTab(page);
|
CloseRepositoryInTab(page);
|
||||||
Pages.RemoveAt(removeIdx);
|
Pages.RemoveAt(removeIdx);
|
||||||
OnPropertyChanged(nameof(Pages));
|
OnPropertyChanged(nameof(Pages));
|
||||||
|
|
Loading…
Reference in a new issue