Forráskód Böngészése

Identify future optimization.

Gert Driesen 8 éve
szülő
commit
847119fd87
1 módosított fájl, 2 hozzáadás és 0 törlés
  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);