mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
refactor: ♻️ use HashCode.Combine for Result hashcode (#2201)
This commit is contained in:
parent
7b8f998065
commit
5dd0d349de
1 changed files with 2 additions and 10 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Runtime;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -172,16 +173,7 @@ namespace Flow.Launcher.Plugin
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
unchecked
|
return HashCode.Combine(Title, SubTitle, AutoCompleteText, CopyText, IcoPath);
|
||||||
{
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue