diff --git a/Source/Cloning/ExpressionTreeCloner.PropertyBased.cs b/Source/Cloning/ExpressionTreeCloner.PropertyBased.cs index f04d8b2..856487b 100644 --- a/Source/Cloning/ExpressionTreeCloner.PropertyBased.cs +++ b/Source/Cloning/ExpressionTreeCloner.PropertyBased.cs @@ -299,7 +299,6 @@ namespace Nuclex.Support.Cloning { variables.Add(clone); int dimensionCount = clonedType.GetArrayRank(); - int baseVariableIndex = variables.Count; Type elementType = clonedType.GetElementType(); var lengths = new List(); diff --git a/Source/Cloning/ExpressionTreeCloner.cs b/Source/Cloning/ExpressionTreeCloner.cs index 6f76f28..a17bd39 100644 --- a/Source/Cloning/ExpressionTreeCloner.cs +++ b/Source/Cloning/ExpressionTreeCloner.cs @@ -263,13 +263,21 @@ namespace Nuclex.Support.Cloning { } /// Compiled cloners that perform shallow clone operations - private static ConcurrentDictionary> shallowFieldBasedCloners; + private static readonly ConcurrentDictionary< + Type, Func + > shallowFieldBasedCloners; /// Compiled cloners that perform deep clone operations - private static ConcurrentDictionary> deepFieldBasedCloners; + private static readonly ConcurrentDictionary< + Type, Func + > deepFieldBasedCloners; /// Compiled cloners that perform shallow clone operations - private static ConcurrentDictionary> shallowPropertyBasedCloners; + private static readonly ConcurrentDictionary< + Type, Func + > shallowPropertyBasedCloners; /// Compiled cloners that perform deep clone operations - private static ConcurrentDictionary> deepPropertyBasedCloners; + private static readonly ConcurrentDictionary< + Type, Func + > deepPropertyBasedCloners; } diff --git a/Source/Cloning/SerializationCloner.cs b/Source/Cloning/SerializationCloner.cs index 5ac6e33..24698dc 100644 --- a/Source/Cloning/SerializationCloner.cs +++ b/Source/Cloning/SerializationCloner.cs @@ -92,7 +92,7 @@ namespace Nuclex.Support.Cloning { } /// Surrogate the that will be selected for any non-primitive types - private ISerializationSurrogate staticSurrogate; + private readonly ISerializationSurrogate staticSurrogate; /// Surrogate selector to escalate to if no surrogate can be provided private ISurrogateSelector chainedSelector; @@ -321,9 +321,9 @@ namespace Nuclex.Support.Cloning { } /// Serializes objects by storing their fields - private static BinaryFormatter fieldBasedFormatter; + private static readonly BinaryFormatter fieldBasedFormatter; /// Serializes objects by storing their properties - private static BinaryFormatter propertyBasedFormatter; + private static readonly BinaryFormatter propertyBasedFormatter; }