diff options
Diffstat (limited to 'crypto/src/openpgp/PGPUserAttributeSubpacketVectorGenerator.cs')
-rw-r--r-- | crypto/src/openpgp/PGPUserAttributeSubpacketVectorGenerator.cs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/crypto/src/openpgp/PGPUserAttributeSubpacketVectorGenerator.cs b/crypto/src/openpgp/PGPUserAttributeSubpacketVectorGenerator.cs index 9d56c8bc3..c61b95b84 100644 --- a/crypto/src/openpgp/PGPUserAttributeSubpacketVectorGenerator.cs +++ b/crypto/src/openpgp/PGPUserAttributeSubpacketVectorGenerator.cs @@ -1,18 +1,15 @@ using System; -using System.Collections; +using System.Collections.Generic; using Org.BouncyCastle.Bcpg.Attr; -using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Bcpg.OpenPgp { public class PgpUserAttributeSubpacketVectorGenerator { - private IList list = Platform.CreateArrayList(); + private readonly List<UserAttributeSubpacket> list = new List<UserAttributeSubpacket>(); - public virtual void SetImageAttribute( - ImageAttrib.Format imageType, - byte[] imageData) + public virtual void SetImageAttribute(ImageAttrib.Format imageType, byte[] imageData) { if (imageData == null) throw new ArgumentException("attempt to set null image", "imageData"); @@ -22,12 +19,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp public virtual PgpUserAttributeSubpacketVector Generate() { - UserAttributeSubpacket[] a = new UserAttributeSubpacket[list.Count]; - for (int i = 0; i < list.Count; ++i) - { - a[i] = (UserAttributeSubpacket)list[i]; - } - return new PgpUserAttributeSubpacketVector(a); + return new PgpUserAttributeSubpacketVector(list.ToArray()); } } } |