diff --git a/Assets/Mirage/Weaver/SerializeFunctionBase.cs b/Assets/Mirage/Weaver/SerializeFunctionBase.cs index 33e9659745..9b90d12314 100644 --- a/Assets/Mirage/Weaver/SerializeFunctionBase.cs +++ b/Assets/Mirage/Weaver/SerializeFunctionBase.cs @@ -18,7 +18,7 @@ private static void Log(string msg) } protected readonly Dictionary funcs = new Dictionary(new TypeReferenceComparer()); - protected readonly Dictionary collectionMethod = new Dictionary(); + protected readonly Dictionary collectionMethods = new Dictionary(); private readonly IWeaverLogger logger; protected readonly ModuleDefinition module; @@ -59,17 +59,17 @@ public void Register(TypeReference dataType, MethodReference methodReference) public void RegisterCollectionMethod(TypeDefinition dataType, MethodReference methodReference) { - if (collectionMethod.ContainsKey(dataType)) + if (collectionMethods.ContainsKey(dataType)) { logger.Warning( $"Registering a {FunctionTypeLog} for {dataType.FullName} when one already exists\n" + - $" old:{collectionMethod[dataType].FullName}\n" + + $" old:{collectionMethods[dataType].FullName}\n" + $" new:{methodReference.FullName}", methodReference.Resolve()); } Log($"Register Collection Method {FunctionTypeLog} for {dataType.FullName}, method:{methodReference.FullName}"); - collectionMethod[dataType] = methodReference; + collectionMethods[dataType] = methodReference; } /// @@ -170,13 +170,12 @@ private MethodReference GenerateFunction(TypeReference typeReference) var typeDefinition = typeReference.Resolve(); // check for collections - var isCollection = collectionMethod.TryGetValue(typeDefinition, out var collectionMethohd); - if (isCollection) + if (collectionMethods.TryGetValue(typeDefinition, out var collectionMethod)) { var genericInstance = (GenericInstanceType)typeReference; var elementType = genericInstance.GenericArguments[0]; - return GenerateCollectionFunction(typeReference, elementType, collectionMethohd); + return GenerateCollectionFunction(typeReference, elementType, collectionMethod); } // check for invalid types