diff --git a/FastGithub.Scanner/GithubContextCollection.cs b/FastGithub.Scanner/GithubContextCollection.cs index 8108aca..81ecee5 100644 --- a/FastGithub.Scanner/GithubContextCollection.cs +++ b/FastGithub.Scanner/GithubContextCollection.cs @@ -7,13 +7,18 @@ namespace FastGithub.Scanner sealed class GithubContextCollection { private readonly object syncRoot = new(); - private readonly HashSet contextHashSet = new(); + private readonly List contextList = new(); public bool Add(GithubContext context) { lock (this.syncRoot) { - return this.contextHashSet.Add(context); + if (this.contextList.Contains(context)) + { + return false; + } + this.contextList.Add(context); + return true; } } @@ -21,7 +26,7 @@ namespace FastGithub.Scanner { lock (this.syncRoot) { - return this.contextHashSet.ToArray(); + return this.contextList.ToArray(); } } @@ -34,7 +39,7 @@ namespace FastGithub.Scanner { lock (this.syncRoot) { - return this.contextHashSet + return this.contextList .Where(item => item.Available && item.Domain == domain) .OrderByDescending(item => item.Statistics.GetSuccessRate()) .ThenBy(item => item.Statistics.GetAvgElapsed()) diff --git a/FastGithub/FastGithub.csproj b/FastGithub/FastGithub.csproj index ab4f45d..9175207 100644 --- a/FastGithub/FastGithub.csproj +++ b/FastGithub/FastGithub.csproj @@ -5,7 +5,7 @@ enable net5.0;net6.0 true - 1.0.2 + 1.0.0-beta1