From 210d57b2548fb70113947534d842986bb48a12c9 Mon Sep 17 00:00:00 2001 From: Paul Fake Date: Mon, 19 Nov 2018 21:09:36 -0500 Subject: [PATCH] IEquatable for speed IEquatable for speed in using EqualityComparer.Default.Equals --- .../ManagedMqttApplicationMessage.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttApplicationMessage.cs b/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttApplicationMessage.cs index bba73b0..e8906e2 100644 --- a/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttApplicationMessage.cs +++ b/Source/MQTTnet.Extensions.ManagedClient/ManagedMqttApplicationMessage.cs @@ -2,10 +2,15 @@ namespace MQTTnet.Extensions.ManagedClient { - public class ManagedMqttApplicationMessage + public class ManagedMqttApplicationMessage : IEquatable { public Guid Id { get; set; } = Guid.NewGuid(); public MqttApplicationMessage ApplicationMessage { get; set; } + + public bool Equals(ManagedMqttApplicationMessage other) + { + return Id.Equals(other.Id); + } } }