Skip to content

Commit c32220b

Browse files
committed
test: streamline ConfigurationOptions cloning process
Signed-off-by: jbrinkman <[email protected]>
1 parent 4009a95 commit c32220b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

sources/Valkey.Glide/Abstract/ConfigurationOptions.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public static ConfigurationOptions Parse(string configuration, bool ignoreUnknow
308308
/// </summary>
309309
public ConfigurationOptions Clone()
310310
{
311-
var cloned = new ConfigurationOptions
311+
return new ConfigurationOptions
312312
{
313313
ClientName = ClientName,
314314
ConnectTimeout = ConnectTimeout,
@@ -321,12 +321,8 @@ public ConfigurationOptions Clone()
321321
reconnectRetryPolicy = reconnectRetryPolicy,
322322
EndPoints = EndPoints.Clone(),
323323
Protocol = Protocol,
324+
ReadFrom = readFrom
324325
};
325-
326-
// Use property setter to ensure validation
327-
cloned.ReadFrom = readFrom;
328-
329-
return cloned;
330326
}
331327

332328
/// <summary>
@@ -532,7 +528,7 @@ private void ValidateAndSetReadFrom()
532528
{
533529
if (tempReadFromStrategy.HasValue)
534530
{
535-
var strategy = tempReadFromStrategy.Value;
531+
ReadFromStrategy strategy = tempReadFromStrategy.Value;
536532

537533
// Validate strategy and AZ combinations
538534
switch (strategy)

0 commit comments

Comments
 (0)