mirror of
https://github.com/moparisthebest/keepass2android
synced 2025-01-11 05:28:34 -05:00
Perf shortcut for PwUuid comparison. Don't write out Zero PwUuid's for custom icons (use null instead)
This commit is contained in:
parent
bf84662857
commit
9f01e834d0
@ -112,6 +112,12 @@ namespace KeePassLib
|
|||||||
Debug.Assert(uuid != null);
|
Debug.Assert(uuid != null);
|
||||||
if(uuid == null) throw new ArgumentNullException("uuid");
|
if(uuid == null) throw new ArgumentNullException("uuid");
|
||||||
|
|
||||||
|
// Shortcut
|
||||||
|
if (Object.ReferenceEquals(this, uuid))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
for(int i = 0; i < UuidSize; ++i)
|
for(int i = 0; i < UuidSize; ++i)
|
||||||
{
|
{
|
||||||
if(m_pbUuid[i] != uuid.m_pbUuid[i]) return false;
|
if(m_pbUuid[i] != uuid.m_pbUuid[i]) return false;
|
||||||
|
@ -584,8 +584,8 @@ namespace KeePassLib.Serialization
|
|||||||
[ProtoMember(5, OverwriteList = true)]
|
[ProtoMember(5, OverwriteList = true)]
|
||||||
public byte[] CustomIconUuid
|
public byte[] CustomIconUuid
|
||||||
{
|
{
|
||||||
get { return mGroup.CustomIconUuid.UuidBytes; }
|
get { return mGroup.CustomIconUuid.EqualsValue(PwUuid.Zero) ? null : mGroup.CustomIconUuid.UuidBytes; ; }
|
||||||
set { mGroup.CustomIconUuid = new PwUuid(value); }
|
set { mGroup.CustomIconUuid = value == null ? PwUuid.Zero : new PwUuid(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[ProtoMember(6)]
|
[ProtoMember(6)]
|
||||||
@ -858,8 +858,8 @@ namespace KeePassLib.Serialization
|
|||||||
[ProtoMember(3, OverwriteList = true)]
|
[ProtoMember(3, OverwriteList = true)]
|
||||||
public byte[] CustomIconUuid
|
public byte[] CustomIconUuid
|
||||||
{
|
{
|
||||||
get { return mEntry.CustomIconUuid.UuidBytes; }
|
get { return mEntry.CustomIconUuid.EqualsValue(PwUuid.Zero) ? null : mEntry.CustomIconUuid.UuidBytes; }
|
||||||
set { mEntry.CustomIconUuid = new PwUuid(value); }
|
set { mEntry.CustomIconUuid = value == null ? PwUuid.Zero : new PwUuid(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
[ProtoMember(4)]
|
[ProtoMember(4)]
|
||||||
|
Loading…
Reference in New Issue
Block a user