mirror of
https://github.com/Caraxi/mare.client.git
synced 2026-02-16 16:27:44 +01:00
optimize hash computation
This commit is contained in:
parent
1aa0563fc0
commit
4cabc39e45
4 changed files with 57 additions and 32 deletions
|
|
@ -91,6 +91,11 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
|
|||
RecreateLazy();
|
||||
}
|
||||
|
||||
public List<(PlayerCharacter Character, Pair? Pair)> FindAllPairs(List<PlayerCharacter> playerCharacters)
|
||||
{
|
||||
return playerCharacters.Select(p => (p, _allClientPairs.Values.FirstOrDefault(f => string.Equals(p.GetHash256(), f.GetPlayerNameHash())))).ToList();
|
||||
}
|
||||
|
||||
public Pair? FindPair(PlayerCharacter? pChar)
|
||||
{
|
||||
if (pChar == null) return null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue