2008-10-12 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Sun, 12 Oct 2008 15:05:08 +0000 (15:05 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Sun, 12 Oct 2008 15:05:08 +0000 (15:05 -0000)
* EnvelopedCms.cs, SignedCms.cs: Remove unneeded field
initialization to their default values.
[Found using Gendarme AvoidUnneededFieldInitializationRule]

svn path=/trunk/mcs/; revision=115569

mcs/class/System.Security/System.Security.Cryptography.Pkcs/ChangeLog
mcs/class/System.Security/System.Security.Cryptography.Pkcs/EnvelopedCms.cs
mcs/class/System.Security/System.Security.Cryptography.Pkcs/SignedCms.cs

index c143d54f23876719fc85ff4feec24274a40d2695..ca7284ae7d23fd37a7cc99f2e25ddeeb6535f712 100644 (file)
@@ -1,3 +1,9 @@
+2008-10-12  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * EnvelopedCms.cs, SignedCms.cs: Remove unneeded field 
+       initialization to their default values.
+       [Found using Gendarme AvoidUnneededFieldInitializationRule]
+
 2006-12-15  Sebastien Pouliot  <sebastien@ximian.com>
 
        * SignedCms.cs: Add missing TODO. Some code exists but depends on 
index 2040b984609b7e35f6046f119617ef0fc1f67991..c982337d7829564a63716f70996c56672652b206 100644 (file)
@@ -82,14 +82,16 @@ namespace System.Security.Cryptography.Pkcs {
                        : this (contentInfo) 
                {
                        _idType = recipientIdentifierType;
-                       _version = ((_idType == SubjectIdentifierType.SubjectKeyIdentifier) ? 2 : 0);
+                       if (_idType == SubjectIdentifierType.SubjectKeyIdentifier)
+                               _version = 2;
                }
 
                public EnvelopedCms (SubjectIdentifierType recipientIdentifierType, ContentInfo contentInfo, AlgorithmIdentifier encryptionAlgorithm)
                        : this (contentInfo, encryptionAlgorithm) 
                {
                        _idType = recipientIdentifierType;
-                       _version = ((_idType == SubjectIdentifierType.SubjectKeyIdentifier) ? 2 : 0);
+                       if (_idType == SubjectIdentifierType.SubjectKeyIdentifier)
+                               _version = 2;
                }
 
                // properties
index 4608aeedae6869105b50f30486c7b4187c56f987..6117fa0677b5019f0dc627f0ef2bb025b560c8da 100644 (file)
@@ -73,21 +73,18 @@ namespace System.Security.Cryptography.Pkcs {
                public SignedCms (SubjectIdentifierType signerIdentifierType) : this ()
                {
                        _type = signerIdentifierType;
-                       _version = 0;
                }
 
                public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo content) 
                        : this (content, false) 
                {
                        _type = signerIdentifierType;
-                       _version = 0;
                }
 
                public SignedCms (SubjectIdentifierType signerIdentifierType, ContentInfo content, bool detached) 
                        : this (content, detached) 
                {
                        _type = signerIdentifierType;
-                       _version = 0;
                }
 
                // properties