Mendel Monteiro-Beckerman 3 лет назад
Родитель
Сommit
3ca37c9909
1 измененных файлов с 4 добавлено и 7 удалено
  1. 4 7
      src/Abc.Zebus.Persistence/Matching/InMemoryMessageMatcher.cs

+ 4 - 7
src/Abc.Zebus.Persistence/Matching/InMemoryMessageMatcher.cs

@@ -82,8 +82,8 @@ namespace Abc.Zebus.Persistence.Matching
             switch (entry.Type)
             {
                 case MatcherEntryType.Message:
-                    var isPairUpSuccessfull = _ackMessageKeys.Remove(new MessageKey(entry.PeerId, entry.MessageId));
-                    if (isPairUpSuccessfull)
+                    var isPairUpSuccessful = _ackMessageKeys.Remove(new MessageKey(entry.PeerId, entry.MessageId));
+                    if (isPairUpSuccessful)
                     {
                         InMemoryAckCount++;
                         return;
@@ -206,7 +206,7 @@ namespace Abc.Zebus.Persistence.Matching
             return purgedMessageCount;
         }
 
-        private struct MessageKey : IEquatable<MessageKey>
+        private readonly struct MessageKey : IEquatable<MessageKey>
         {
             private readonly PeerId _peerId;
             private readonly MessageId _messageId;
@@ -217,10 +217,7 @@ namespace Abc.Zebus.Persistence.Matching
                 _peerId = peerId;
             }
 
-            public bool Equals(MessageKey other)
-            {
-                return _peerId.Equals(other._peerId) && _messageId.Equals(other._messageId);
-            }
+            public bool Equals(MessageKey other) => _peerId.Equals(other._peerId) && _messageId.Equals(other._messageId);
 
             public override int GetHashCode()
             {