Explorar o código

Identify future optimization.

Gert Driesen %!s(int64=8) %!d(string=hai) anos
pai
achega
847119fd87
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/Renci.SshNet/Session.cs

+ 2 - 0
src/Renci.SshNet/Session.cs

@@ -1061,6 +1061,8 @@ namespace Renci.SshNet
                 var clientHash = _serverMac.ComputeHash(data, 0, data.Length - serverMacLength);
                 var serverHash = data.Take(data.Length - serverMacLength, serverMacLength);
 
+                // TODO add IsEqualTo overload that takes left+right index and number of bytes to compare;
+                // TODO that way we can eliminate the extrate allocation of the Take above
                 if (!serverHash.IsEqualTo(clientHash))
                 {
                     throw new SshConnectionException("MAC error", DisconnectReason.MacError);