예제 #1
0
 internal bool IsEqual(CommandBytes expected)
 {
     if (expected.Length != Payload.Length)
     {
         return(false);
     }
     return(new CommandBytes(Payload).Equals(expected));
 }
예제 #2
0
        internal bool StartsWith(CommandBytes expected)
        {
            var len = expected.Length;

            if (len > Payload.Length)
            {
                return(false);
            }

            var rangeToCheck = Payload.Slice(0, len);

            return(new CommandBytes(rangeToCheck).Equals(expected));
        }
예제 #3
0
 internal void AppendDeltas(StringBuilder sb)
 {
     for (int i = 0; i < map.Length; i++)
     {
         var keyString = ((RedisCommand)i).ToString();
         var keyBytes  = new CommandBytes(keyString);
         var value     = map[i];
         if (!keyBytes.Equals(value))
         {
             if (sb.Length != 0)
             {
                 sb.Append(',');
             }
             sb.Append('$').Append(keyString).Append('=').Append(value);
         }
     }
 }