mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
move number become const
This commit is contained in:
parent
d09ff638b3
commit
3051afad01
1 changed files with 8 additions and 5 deletions
|
|
@ -10,6 +10,9 @@ namespace Flow.Launcher.Storage
|
|||
{
|
||||
public class UserSelectedRecord
|
||||
{
|
||||
private const int HASH_MULTIPLIER = 31;
|
||||
private const int HASH_INITIAL = 23;
|
||||
|
||||
[JsonInclude]
|
||||
public Dictionary<int, int> records { get; private set; }
|
||||
|
||||
|
|
@ -20,7 +23,7 @@ namespace Flow.Launcher.Storage
|
|||
|
||||
private static int GenerateCustomHashCode(Query query, Result result)
|
||||
{
|
||||
int hashcode = 23;
|
||||
int hashcode = HASH_INITIAL;
|
||||
|
||||
unchecked
|
||||
{
|
||||
|
|
@ -31,25 +34,25 @@ namespace Flow.Launcher.Storage
|
|||
for (int i = 0; i < query.ActionKeyword.Length; i++)
|
||||
{
|
||||
char item = query.ActionKeyword[i];
|
||||
hashcode = hashcode * 31 + item;
|
||||
hashcode = hashcode * HASH_MULTIPLIER + item;
|
||||
}
|
||||
|
||||
for (int i = 0; i < query.Search.Length; i++)
|
||||
{
|
||||
char item = query.Search[i];
|
||||
hashcode = hashcode * 31 + item;
|
||||
hashcode = hashcode * HASH_MULTIPLIER + item;
|
||||
}
|
||||
|
||||
for (int i = 0; i < result.Title.Length; i++)
|
||||
{
|
||||
char item = result.Title[i];
|
||||
hashcode = hashcode * 31 + item;
|
||||
hashcode = hashcode * HASH_MULTIPLIER + item;
|
||||
}
|
||||
|
||||
for (int i = 0; i < result.SubTitle.Length; i++)
|
||||
{
|
||||
char item = result.SubTitle[i];
|
||||
hashcode = hashcode * 31 + item;
|
||||
hashcode = hashcode * HASH_MULTIPLIER + item;
|
||||
}
|
||||
return hashcode;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue