mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00: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…
Add table
Add a link
Reference in a new issue