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