@@ -285,14 +285,14 @@ public static Condition StringNotEqual(RedisKey key, RedisValue value)
285285 public static Condition SortedSetNotContains ( RedisKey key , RedisValue member ) => new ExistsCondition ( key , RedisType . SortedSet , member , false ) ;
286286
287287 /// <summary>
288- /// Enforces that the given sorted set contains a member that ist starting with the start-sequence
288+ /// Enforces that the given sorted set contains a member that ist starting with the start-sequence.
289289 /// </summary>
290290 /// <param name="key">The key of the sorted set to check.</param>
291291 /// <param name="memberStartSequence">a byte array: the set must contain at least one member, that starts with the byte-sequence.</param>
292292 public static Condition SortedSetStartsWith ( RedisKey key , byte [ ] memberStartSequence ) => new StartsWithCondition ( key , memberStartSequence , true ) ;
293293
294294 /// <summary>
295- /// Enforces that the given sorted set does not contain a member that ist starting with the start-sequence
295+ /// Enforces that the given sorted set does not contain a member that ist starting with the start-sequence.
296296 /// </summary>
297297 /// <param name="key">The key of the sorted set to check.</param>
298298 /// <param name="memberStartSequence">a byte array: the set must not contain any members, that start with the byte-sequence.</param>
@@ -441,7 +441,7 @@ protected override void WriteImpl(PhysicalConnection physical)
441441 }
442442 else
443443 {
444- physical . WriteHeader ( command , value1 . IsNull ? 2 : value2 . IsNull ? 3 : value3 . IsNull ? 4 : value4 . IsNull ? 5 : 6 ) ;
444+ physical . WriteHeader ( command , value1 . IsNull ? 2 : value2 . IsNull ? 3 : value3 . IsNull ? 4 : value4 . IsNull ? 5 : 6 ) ;
445445 physical . Write ( Key ) ;
446446 physical . WriteBulkString ( value ) ;
447447 if ( ! value1 . IsNull )
@@ -454,7 +454,7 @@ protected override void WriteImpl(PhysicalConnection physical)
454454 physical . WriteBulkString ( value4 ) ;
455455 }
456456 }
457- public override int ArgCount => value . IsNull ? 1 : value1 . IsNull ? 2 : value2 . IsNull ? 3 : value3 . IsNull ? 4 : value4 . IsNull ? 5 : 6 ;
457+ public override int ArgCount => value . IsNull ? 1 : value1 . IsNull ? 2 : value2 . IsNull ? 3 : value3 . IsNull ? 4 : value4 . IsNull ? 5 : 6 ;
458458 }
459459 }
460460
@@ -536,9 +536,9 @@ internal override bool TryValidate(in RawResult result, out bool value)
536536
537537 internal sealed class StartsWithCondition : Condition
538538 {
539- // only usable for RedisType.SortedSet, members of SortedSets are always byte-arrays, expectedStartValue therefore is a byte-array
540- // any Encoding and Conversion for the search-sequence has to be executed in calling application
541- // working with byte arrays should prevent any encoding within this class, that could distort the comparison
539+ /* only usable for RedisType.SortedSet, members of SortedSets are always byte-arrays, expectedStartValue therefore is a byte-array
540+ any Encoding and Conversion for the search-sequence has to be executed in calling application
541+ working with byte arrays should prevent any encoding within this class, that could distort the comparison */
542542
543543 private readonly bool expectedResult ;
544544 private readonly RedisValue expectedStartValue ;
@@ -566,10 +566,10 @@ internal override IEnumerable<Message> CreateMessages(int db, IResultBox? result
566566 {
567567 yield return Message . Create ( db , CommandFlags . None , RedisCommand . WATCH , key ) ;
568568
569- #pragma warning disable CS8600 , CS8604 // expectedStartValue is checked to be not null in Constructor and must be a byte[] because of API-parameters
569+ #pragma warning disable CS8600 , CS8604 , SA1117 // expectedStartValue is checked to be not null in Constructor and must be a byte[] because of API-parameters
570570 var message = ConditionProcessor . CreateMessage ( this , db , CommandFlags . None , RedisCommand . ZRANGEBYLEX , key ,
571- CombineBytes ( 91 , ( byte [ ] ) expectedStartValue . Box ( ) ) , "+" , "LIMIT" , "0" , "1" ) ; // prepends '[' to startValue for inclusive search in CombineBytes
572- #pragma warning disable CS8600 , CS8604
571+ CombineBytes ( 91 , ( byte [ ] ) expectedStartValue . Box ( ) ) , "+" , "LIMIT" , "0" , "1" ) ; // prepends '[' to startValue for inclusive search in CombineBytes
572+ #pragma warning disable CS8600 , CS8604 , SA1117
573573 message . SetSource ( ConditionProcessor . Default , resultBox ) ;
574574 yield return message ;
575575 }
@@ -579,7 +579,7 @@ internal override IEnumerable<Message> CreateMessages(int db, IResultBox? result
579579 internal override bool TryValidate ( in RawResult result , out bool value )
580580 {
581581 RedisValue [ ] ? r = result . GetItemsAsValues ( ) ;
582- if ( result . ItemsCount == 0 ) value = false ; // false, if empty list -> read after end of memberlist / itemsCout > 1 is impossible due to 'LIMIT 0 1'
582+ if ( result . ItemsCount == 0 ) value = false ; // false, if empty list -> read after end of memberlist / itemsCout > 1 is impossible due to 'LIMIT 0 1'
583583#pragma warning disable CS8600 , CS8604 // warnings on StartsWith can be ignored because of ItemsCount-check in then preceding command!!
584584 else value = r != null && r . Length > 0 && StartsWith ( ( byte [ ] ) r [ 0 ] . Box ( ) , expectedStartValue ) ;
585585#pragma warning disable CS8600 , CS8604
@@ -590,11 +590,11 @@ internal override bool TryValidate(in RawResult result, out bool value)
590590 + "; expected: " + expectedStartValue . ToString ( )
591591 + "; wanted: " + ( expectedResult ? "StartsWith" : "NotStartWith" )
592592 + "; voting: " + value ) ;
593- #pragma warning restore CS8602
593+ #pragma warning restore CS8602
594594 return true ;
595595 }
596596
597- private static byte [ ] CombineBytes ( byte b1 , byte [ ] a1 ) // combines b1 and a1 to new array
597+ private static byte [ ] CombineBytes ( byte b1 , byte [ ] a1 ) // combines b1 and a1 to new array
598598 {
599599 byte [ ] newArray = new byte [ a1 . Length + 1 ] ;
600600 newArray [ 0 ] = b1 ;
@@ -613,11 +613,8 @@ internal bool StartsWith(byte[] result, byte[] searchfor)
613613
614614 return true ;
615615 }
616-
617-
618616 }
619617
620-
621618 internal sealed class EqualsCondition : Condition
622619 {
623620 internal override Condition MapKeys ( Func < RedisKey , RedisKey > map ) =>
0 commit comments