Skip to content

Commit 5dd0d34

Browse files
committed
refactor: ♻️ use HashCode.Combine for Result hashcode (#2201)
1 parent 7b8f998 commit 5dd0d34

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Flow.Launcher.Plugin/Result.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Runtime;
23
using System.Collections.Generic;
34
using System.IO;
45
using System.Threading.Tasks;
@@ -172,16 +173,7 @@ public override bool Equals(object obj)
172173
/// <inheritdoc />
173174
public override int GetHashCode()
174175
{
175-
unchecked
176-
{
177-
// 17 and 23 are prime numbers
178-
int hashcode = 17;
179-
hashcode = hashcode * 23 + (Title?.GetHashCode() ?? 0);
180-
hashcode = hashcode * 23 + (SubTitle?.GetHashCode() ?? 0);
181-
hashcode = hashcode * 23 + (AutoCompleteText?.GetHashCode() ?? 0);
182-
hashcode = hashcode * 23 + (CopyText?.GetHashCode() ?? 0);
183-
return hashcode;
184-
}
176+
return HashCode.Combine(Title, SubTitle, AutoCompleteText, CopyText, IcoPath);
185177
}
186178

187179
/// <inheritdoc />

0 commit comments

Comments
 (0)