Commit c94917a1 authored by Marc Gravell's avatar Marc Gravell

Merge pull request #260 from leosvelperez/master

#248 Exchanging operands in the ternary operators of server selection in TryResend in ServerSelectionStrategy
parents fada6f5d ca4b43fd
...@@ -133,13 +133,13 @@ public bool TryResend(int hashSlot, Message message, EndPoint endpoint, bool isM ...@@ -133,13 +133,13 @@ public bool TryResend(int hashSlot, Message message, EndPoint endpoint, bool isM
switch (Message.GetMasterSlaveFlags(message.Flags)) switch (Message.GetMasterSlaveFlags(message.Flags))
{ {
case CommandFlags.DemandMaster: case CommandFlags.DemandMaster:
resendVia = server.IsSelectable(command) ? null : server; resendVia = server.IsSelectable(command) ? server : null;
break; break;
case CommandFlags.PreferMaster: case CommandFlags.PreferMaster:
resendVia = server.IsSelectable(command) ? FindSlave(server, command) : server; resendVia = server.IsSelectable(command) ? server : FindSlave(server, command);
break; break;
case CommandFlags.PreferSlave: case CommandFlags.PreferSlave:
resendVia = FindSlave(server, command) ?? (server.IsSelectable(command) ? null : server); resendVia = FindSlave(server, command) ?? (server.IsSelectable(command) ? server : null);
break; break;
case CommandFlags.DemandSlave: case CommandFlags.DemandSlave:
resendVia = FindSlave(server, command); 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