mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 05:10:25 +08:00
enhance: use string.Equals instead of operator ==
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -66,7 +66,7 @@ namespace SourceGit.ViewModels
|
||||
if (SetProperty(ref _commits, value))
|
||||
{
|
||||
if (value.Count > 0 && lastSelected != null)
|
||||
SelectedCommit = value.Find(x => x.SHA == lastSelected.SHA);
|
||||
SelectedCommit = value.Find(x => x.SHA.Equals(lastSelected.SHA, StringComparison.Ordinal));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,8 +222,8 @@ namespace SourceGit.ViewModels
|
||||
else if (commits.Count == 1)
|
||||
{
|
||||
var commit = (commits[0] as Models.Commit)!;
|
||||
if (_repo.SearchCommitContext.Selected == null || _repo.SearchCommitContext.Selected.SHA != commit.SHA)
|
||||
_repo.SearchCommitContext.Selected = _repo.SearchCommitContext.Results?.Find(x => x.SHA == commit.SHA);
|
||||
if (_repo.SearchCommitContext.Selected == null || !_repo.SearchCommitContext.Selected.SHA.Equals(commit.SHA, StringComparison.Ordinal))
|
||||
_repo.SearchCommitContext.Selected = _repo.SearchCommitContext.Results?.Find(x => x.SHA.Equals(commit.SHA, StringComparison.Ordinal));
|
||||
|
||||
SelectedCommit = commit;
|
||||
NavigationId = _navigationId + 1;
|
||||
@@ -366,7 +366,7 @@ namespace SourceGit.ViewModels
|
||||
var parents = new List<Models.Commit>();
|
||||
foreach (var sha in commit.Parents)
|
||||
{
|
||||
var parent = _commits.Find(x => x.SHA == sha);
|
||||
var parent = _commits.Find(x => x.SHA.Equals(sha, StringComparison.Ordinal));
|
||||
if (parent == null)
|
||||
parent = await new Commands.QuerySingleCommit(_repo.FullPath, sha).GetResultAsync();
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@ namespace SourceGit.Views
|
||||
{
|
||||
var currentParent = this.FindAncestorOfType<CommitBaseInfo>();
|
||||
if (currentParent is { DataContext: ViewModels.CommitDetail currentDetail } &&
|
||||
currentDetail.Commit.SHA == lastDetailCommit)
|
||||
currentDetail.Commit.SHA.Equals(lastDetailCommit, StringComparison.Ordinal))
|
||||
{
|
||||
_inlineCommits.TryAdd(sha, c);
|
||||
if (_lastHover == link && c != null)
|
||||
|
||||
Reference in New Issue
Block a user