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
......@@ -132,14 +132,14 @@ public bool TryResend(int hashSlot, Message message, EndPoint endpoint, bool isM
var command = message.Command;
switch (Message.GetMasterSlaveFlags(message.Flags))
{
case CommandFlags.DemandMaster:
resendVia = server.IsSelectable(command) ? null : server;
case CommandFlags.DemandMaster:
resendVia = server.IsSelectable(command) ? server : null;
break;
case CommandFlags.PreferMaster:
resendVia = server.IsSelectable(command) ? FindSlave(server, command) : server;
case CommandFlags.PreferMaster:
resendVia = server.IsSelectable(command) ? server : FindSlave(server, command);
break;
case CommandFlags.PreferSlave:
resendVia = FindSlave(server, command) ?? (server.IsSelectable(command) ? null : server);
case CommandFlags.PreferSlave:
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