fix performance oversight

This commit is contained in:
rootdarkarchon
2023-03-27 15:31:16 +02:00
parent 0f623510b5
commit 4f8b986936
2 changed files with 6 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<Authors></Authors> <Authors></Authors>
<Company></Company> <Company></Company>
<Version>0.8.15</Version> <Version>0.8.16</Version>
<Description></Description> <Description></Description>
<Copyright></Copyright> <Copyright></Copyright>
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl> <PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>

View File

@@ -93,7 +93,11 @@ public sealed class PairManager : DisposableMediatorSubscriberBase
public List<(PlayerCharacter Character, Pair? Pair)> FindAllPairs(List<PlayerCharacter> playerCharacters) 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(); return playerCharacters.Select(p =>
{
var hash = p.GetHash256();
return (p, _allClientPairs.Values.FirstOrDefault(f => string.Equals(hash, f.GetPlayerNameHash())));
}).ToList();
} }
public Pair? FindPair(PlayerCharacter? pChar) public Pair? FindPair(PlayerCharacter? pChar)