From 5dd0d349de50ce1bfa925d317d3e4494eb891bbf Mon Sep 17 00:00:00 2001 From: James Date: Mon, 26 Jun 2023 13:51:37 +1200 Subject: [PATCH] refactor: :recycle: use `HashCode.Combine` for `Result` hashcode (#2201) --- Flow.Launcher.Plugin/Result.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 2fd8f500b..7e4446662 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; @@ -172,16 +173,7 @@ namespace Flow.Launcher.Plugin /// public override int GetHashCode() { - unchecked - { - // 17 and 23 are prime numbers - int hashcode = 17; - hashcode = hashcode * 23 + (Title?.GetHashCode() ?? 0); - hashcode = hashcode * 23 + (SubTitle?.GetHashCode() ?? 0); - hashcode = hashcode * 23 + (AutoCompleteText?.GetHashCode() ?? 0); - hashcode = hashcode * 23 + (CopyText?.GetHashCode() ?? 0); - return hashcode; - } + return HashCode.Combine(Title, SubTitle, AutoCompleteText, CopyText, IcoPath); } ///