Пример #1
0
 public override int GetHashCode(ArraySegment <byte> key)
 {
     if (key.Array == null || key.Count == 0)
     {
         return(0);
     }
     return(ByteArrayComparer.GetHashCode(key.Array, key.Offset, key.Count));
 }
Пример #2
0
 public override int GetHashCode(byte[] key)
 {
     if (key == null || key.Length == 0)
     {
         return(0);
     }
     return(ByteArrayComparer.GetHashCode(key));
 }
Пример #3
0
 public override bool KeyEquals(ArraySegment <byte> key1, byte[] key2)
 {
     if (key1.Array == null && key2 == null)
     {
         return(true);
     }
     if (key1.Array == null || key2 == null)
     {
         return(false);
     }
     return(ByteArrayComparer.Equals(key1.Array, key1.Offset, key1.Count, key2, 0, key2.Length));
 }