summary refs log tree commit diff
path: root/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs')
-rw-r--r--crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs17
1 files changed, 4 insertions, 13 deletions
diff --git a/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs b/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs

index df5081390..e9a42e4b7 100644 --- a/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs +++ b/crypto/src/openpgp/PgpUserAttributeSubpacketVector.cs
@@ -4,6 +4,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp { /// <remarks>Container for a list of user attribute subpackets.</remarks> public class PgpUserAttributeSubpacketVector + : IUserDataPacket { public static PgpUserAttributeSubpacketVector FromSubpackets(UserAttributeSubpacket[] packets) { @@ -22,15 +23,12 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp this.packets = packets; } - public UserAttributeSubpacket GetSubpacket( - UserAttributeSubpacketTag type) + public UserAttributeSubpacket GetSubpacket(UserAttributeSubpacketTag type) { for (int i = 0; i != packets.Length; i++) { if (packets[i].SubpacketType == type) - { return packets[i]; - } } return null; @@ -48,28 +46,21 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp return packets; } - public override bool Equals( - object obj) + public override bool Equals(object obj) { if (obj == this) return true; - PgpUserAttributeSubpacketVector other = obj as PgpUserAttributeSubpacketVector; - - if (other == null) + if (!(obj is PgpUserAttributeSubpacketVector other)) return false; if (other.packets.Length != packets.Length) - { return false; - } for (int i = 0; i != packets.Length; i++) { if (!other.packets[i].Equals(packets[i])) - { return false; - } } return true;