Remove Version.Clone from AssemblyName.Clone (#54621)
authorStephen Toub <stoub@microsoft.com>
Thu, 24 Jun 2021 04:00:01 +0000 (00:00 -0400)
committerGitHub <noreply@github.com>
Thu, 24 Jun 2021 04:00:01 +0000 (00:00 -0400)
Version is immutable.

src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyName.cs

index 0853bff..4291dde 100644 (file)
@@ -126,7 +126,7 @@ namespace System.Reflection
                 _publicKey = (byte[]?)_publicKey?.Clone(),
                 _publicKeyToken = (byte[]?)_publicKeyToken?.Clone(),
                 _cultureInfo = _cultureInfo,
-                _version = (Version?)_version?.Clone(),
+                _version = _version,
                 _flags = _flags,
                 _codeBase = _codeBase,
                 _hashAlgorithm = _hashAlgorithm,