mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-21 02:15:00 +00:00
Simplify/optimize WorkingCopy.IsChanged(), also react to change in sort order
This commit is contained in:
parent
72bc0c2a3f
commit
8483411e58
1 changed files with 4 additions and 9 deletions
|
@ -1778,16 +1778,11 @@ namespace SourceGit.ViewModels
|
||||||
if (old.Count != cur.Count)
|
if (old.Count != cur.Count)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var oldMap = new Dictionary<string, Models.Change>();
|
for (int idx = 0; idx < old.Count; idx++)
|
||||||
foreach (var c in old)
|
|
||||||
oldMap.Add(c.Path, c);
|
|
||||||
|
|
||||||
foreach (var c in cur)
|
|
||||||
{
|
{
|
||||||
if (!oldMap.TryGetValue(c.Path, out var o))
|
var o = old[idx];
|
||||||
return true;
|
var c = cur[idx];
|
||||||
|
if (o.Path != c.Path || o.Index != c.Index || o.WorkTree != c.WorkTree)
|
||||||
if (o.Index != c.Index || o.WorkTree != c.WorkTree)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue