mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00
enhance: improve update filter mode performance
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
4b6bb70f20
commit
8d84d0f6a1
2 changed files with 27 additions and 30 deletions
|
@ -152,18 +152,12 @@ namespace SourceGit.Models
|
|||
set;
|
||||
} = "---";
|
||||
|
||||
public FilterMode GetHistoriesFilterMode(string pattern, FilterType type)
|
||||
public Dictionary<string, FilterMode> CollectHistoriesFilters()
|
||||
{
|
||||
var map = new Dictionary<string, FilterMode>();
|
||||
foreach (var filter in HistoriesFilters)
|
||||
{
|
||||
if (filter.Type != type)
|
||||
continue;
|
||||
|
||||
if (filter.Pattern.Equals(pattern, StringComparison.Ordinal))
|
||||
return filter.Mode;
|
||||
}
|
||||
|
||||
return FilterMode.None;
|
||||
map.Add(filter.Pattern, filter.Mode);
|
||||
return map;
|
||||
}
|
||||
|
||||
public bool UpdateHistoriesFilter(string pattern, FilterType type, FilterMode mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue