Skip to content

Commit daf4104

Browse files
committed
more cleanup
1 parent be3bbfd commit daf4104

File tree

187 files changed

+13582
-13843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+13582
-13843
lines changed

src/NRedisStack/Auxiliary.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ internal static void SetInfoInPipeline(this IDatabase db)
5454
{
5555
_setInfo = false;
5656
if (_libraryName == null) return;
57-
Pipeline pipeline = new Pipeline(db);
58-
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryName, _libraryName!);
57+
Pipeline pipeline = new(db);
58+
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryName, _libraryName);
5959
_ = pipeline.Db.ClientSetInfoAsync(SetInfoAttr.LibraryVersion, GetNRedisStackVersion());
6060
pipeline.Execute();
6161
}

src/NRedisStack/Bloom/BloomCommandBuilder.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ public static class BloomCommandBuilder
77
{
88
public static SerializedCommand Add(RedisKey key, RedisValue item)
99
{
10-
return new SerializedCommand(BF.ADD, key, item);
10+
return new(BF.ADD, key, item);
1111
}
1212

1313
public static SerializedCommand Card(RedisKey key)
1414
{
15-
return new SerializedCommand(BF.CARD, key);
15+
return new(BF.CARD, key);
1616
}
1717

1818
public static SerializedCommand Exists(RedisKey key, RedisValue item)
1919
{
20-
return new SerializedCommand(BF.EXISTS, key, item);
20+
return new(BF.EXISTS, key, item);
2121
}
2222

2323
public static SerializedCommand Info(RedisKey key)
2424
{
25-
return new SerializedCommand(BF.INFO, key);
25+
return new(BF.INFO, key);
2626
}
2727

2828
public static SerializedCommand Insert(RedisKey key, RedisValue[] items, int? capacity = null,
@@ -34,41 +34,41 @@ public static SerializedCommand Insert(RedisKey key, RedisValue[] items, int? ca
3434

3535
var args = BloomAux.BuildInsertArgs(key, items, capacity, error, expansion, nocreate, nonscaling);
3636

37-
return new SerializedCommand(BF.INSERT, args);
37+
return new(BF.INSERT, args);
3838
}
3939

4040
public static SerializedCommand LoadChunk(RedisKey key, long iterator, Byte[] data)
4141
{
42-
return new SerializedCommand(BF.LOADCHUNK, key, iterator, data);
42+
return new(BF.LOADCHUNK, key, iterator, data);
4343
}
4444

4545
public static SerializedCommand MAdd(RedisKey key, params RedisValue[] items)
4646
{
4747
if (items.Length < 1)
4848
throw new ArgumentOutOfRangeException(nameof(items));
4949

50-
List<object> args = new List<object> { key };
50+
List<object> args = [key];
5151
args.AddRange(items.Cast<object>());
5252

53-
return new SerializedCommand(BF.MADD, args);
53+
return new(BF.MADD, args);
5454
}
5555

5656
public static SerializedCommand MExists(RedisKey key, RedisValue[] items)
5757
{
5858
if (items.Length < 1)
5959
throw new ArgumentOutOfRangeException(nameof(items));
6060

61-
List<object> args = new List<object> { key };
61+
List<object> args = [key];
6262
args.AddRange(items.Cast<object>());
6363

64-
return new SerializedCommand(BF.MEXISTS, args);
64+
return new(BF.MEXISTS, args);
6565

6666
}
6767

6868
public static SerializedCommand Reserve(RedisKey key, double errorRate, long capacity,
6969
int? expansion = null, bool nonscaling = false)
7070
{
71-
List<object> args = new List<object> { key, errorRate, capacity };
71+
List<object> args = [key, errorRate, capacity];
7272

7373
if (expansion != null)
7474
{
@@ -80,11 +80,11 @@ public static SerializedCommand Reserve(RedisKey key, double errorRate, long cap
8080
args.Add(BloomArgs.NONSCALING);
8181
}
8282

83-
return new SerializedCommand(BF.RESERVE, args);
83+
return new(BF.RESERVE, args);
8484
}
8585

8686
public static SerializedCommand ScanDump(RedisKey key, long iterator)
8787
{
88-
return new SerializedCommand(BF.SCANDUMP, key, iterator);
88+
return new(BF.SCANDUMP, key, iterator);
8989
}
9090
}
Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
namespace NRedisStack.Bloom.DataTypes
1+
namespace NRedisStack.Bloom.DataTypes;
2+
3+
/// <summary>
4+
/// This class represents the response for BF.INFO command.
5+
/// This object has Read-only properties and cannot be generated outside a BF.INFO response.
6+
/// </summary>
7+
public class BloomInformation
28
{
3-
/// <summary>
4-
/// This class represents the response for BF.INFO command.
5-
/// This object has Read-only properties and cannot be generated outside a BF.INFO response.
6-
/// </summary>
7-
public class BloomInformation
8-
{
9-
public long Capacity { get; private set; }
10-
public long Size { get; private set; }
11-
public long NumberOfFilters { get; private set; }
12-
public long NumberOfItemsInserted { get; private set; }
13-
public long ExpansionRate { get; private set; }
9+
public long Capacity { get; private set; }
10+
public long Size { get; private set; }
11+
public long NumberOfFilters { get; private set; }
12+
public long NumberOfItemsInserted { get; private set; }
13+
public long ExpansionRate { get; private set; }
1414

15-
internal BloomInformation(long capacity, long size, long numberOfFilters, long numberOfItemsInserted, long expansionRate)
16-
{
17-
Capacity = capacity;
18-
Size = size;
19-
NumberOfFilters = numberOfFilters;
20-
NumberOfItemsInserted = numberOfItemsInserted;
21-
ExpansionRate = expansionRate;
22-
}
15+
internal BloomInformation(long capacity, long size, long numberOfFilters, long numberOfItemsInserted, long expansionRate)
16+
{
17+
Capacity = capacity;
18+
Size = size;
19+
NumberOfFilters = numberOfFilters;
20+
NumberOfItemsInserted = numberOfItemsInserted;
21+
ExpansionRate = expansionRate;
2322
}
2423
}
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
namespace NRedisStack.Bloom.Literals
1+
namespace NRedisStack.Bloom.Literals;
2+
3+
internal class BloomArgs
24
{
3-
internal class BloomArgs
4-
{
5-
public const string CAPACITY = "CAPACITY";
6-
public const string ERROR = "ERROR";
7-
public const string EXPANSION = "EXPANSION";
8-
public const string NOCREATE = "NOCREATE";
9-
public const string NONSCALING = "NONSCALING";
10-
public const string ITEMS = "ITEMS";
11-
}
5+
public const string CAPACITY = "CAPACITY";
6+
public const string ERROR = "ERROR";
7+
public const string EXPANSION = "EXPANSION";
8+
public const string NOCREATE = "NOCREATE";
9+
public const string NONSCALING = "NONSCALING";
10+
public const string ITEMS = "ITEMS";
1211
}
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
namespace NRedisStack.Bloom.Literals
1+
namespace NRedisStack.Bloom.Literals;
2+
3+
internal class BF
24
{
3-
internal class BF
4-
{
5-
public const string ADD = "BF.ADD";
6-
public const string CARD = "BF.CARD";
7-
public const string EXISTS = "BF.EXISTS";
8-
public const string INFO = "BF.INFO";
9-
public const string INSERT = "BF.INSERT";
10-
public const string LOADCHUNK = "BF.LOADCHUNK";
11-
public const string MADD = "BF.MADD";
12-
public const string MEXISTS = "BF.MEXISTS";
13-
public const string RESERVE = "BF.RESERVE";
14-
public const string SCANDUMP = "BF.SCANDUMP";
15-
}
5+
public const string ADD = "BF.ADD";
6+
public const string CARD = "BF.CARD";
7+
public const string EXISTS = "BF.EXISTS";
8+
public const string INFO = "BF.INFO";
9+
public const string INSERT = "BF.INSERT";
10+
public const string LOADCHUNK = "BF.LOADCHUNK";
11+
public const string MADD = "BF.MADD";
12+
public const string MEXISTS = "BF.MEXISTS";
13+
public const string RESERVE = "BF.RESERVE";
14+
public const string SCANDUMP = "BF.SCANDUMP";
1615
}

0 commit comments

Comments
 (0)