Skip to content

Commit d694cb4

Browse files
committed
fix formatting rules
1 parent 6d47ad1 commit d694cb4

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

src/StackExchange.Redis/Condition.cs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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) =>

tests/StackExchange.Redis.Tests/LexTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public async Task QueryRangeAndLengthByLex()
4545
set = db.SortedSetRangeByValue(key, "aaa", "g", Exclude.Stop, Order.Descending, 1, 3);
4646
Equate(set, set.Length, "e", "d", "c");
4747

48-
4948
set = db.SortedSetRangeByValue(key, "g", "aaa", Exclude.Start, Order.Descending, 1, 3);
5049
Equate(set, set.Length, "e", "d", "c");
5150

tests/StackExchange.Redis.Tests/TransactionTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,6 @@ public async Task BasicTranWithSortedSetContainsCondition(bool demandKeyExists,
812812
}
813813
}
814814

815-
816815
[Theory]
817816
[InlineData(false, false, true)]
818817
[InlineData(false, true, false)]

0 commit comments

Comments
 (0)