Exchanging operands in the ternary operators of server selection in TryResend...

Exchanging operands in the ternary operators of server selection in TryResend in ServerSelectionStrategy
parent 83a046eb
......@@ -133,13 +133,13 @@ public bool TryResend(int hashSlot, Message message, EndPoint endpoint, bool isM
switch (Message.GetMasterSlaveFlags(message.Flags))
{
case CommandFlags.DemandMaster:
resendVia = server.IsSelectable(command) ? null : server;
resendVia = server.IsSelectable(command) ? server : null;
break;
case CommandFlags.PreferMaster:
resendVia = server.IsSelectable(command) ? FindSlave(server, command) : server;
resendVia = server.IsSelectable(command) ? server : FindSlave(server, command);
break;
case CommandFlags.PreferSlave:
resendVia = FindSlave(server, command) ?? (server.IsSelectable(command) ? null : server);
resendVia = FindSlave(server, command) ?? (server.IsSelectable(command) ? server : null);
break;
case CommandFlags.DemandSlave:
resendVia = FindSlave(server, command);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment