Take advantage of ImmutableDictionary in Animations.ToDictionary()

This commit is contained in:
cinder
2025-05-28 18:18:53 -05:00
parent 3ebed429e5
commit a12d5fa8f6
3 changed files with 163 additions and 158 deletions

View File

@@ -26,6 +26,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Reflection;
using System.Text;
@@ -1424,7 +1425,7 @@ namespace OpenMetaverse.Packets
private static string DecodeAnimToConst(string fieldName, object fieldData)
{
string animConst = "UUID";
Dictionary<UUID, string> animsDict = Animations.ToDictionary();
ImmutableDictionary<UUID, string> animsDict = Animations.ToDictionary();
if (animsDict.ContainsKey((UUID) fieldData))
animConst = animsDict[(UUID) fieldData];
return $"{fieldName,30}: {fieldData,-40} [{animConst}]";
@@ -1753,4 +1754,4 @@ namespace OpenMetaverse.Packets
return result.ToString();
}
}
}
}