瀏覽代碼

Housekeeping

Mendel Monteiro-Beckerman 3 年之前
父節點
當前提交
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()
             {