private MoveHint[] GetMoveHints(LiveInterval liveInterval)
{
MoveHint startMoveHint = null;
MoveHint endMoveHint = null;
moveHints.TryGetValue(liveInterval.Start, out startMoveHint);
if (!liveInterval.End.IsBlockStartInstruction)
moveHints.TryGetValue(liveInterval.End, out endMoveHint);
int cnt = (startMoveHint == null ? 0 : 1) + (endMoveHint == null ? 0 : 1);
if (cnt == 0)
return null;
var hints = new MoveHint[cnt];
if (startMoveHint != null && endMoveHint != null)
{
// sorted by bonus
if (startMoveHint.Bonus > endMoveHint.Bonus)
{
hints[0] = startMoveHint;
hints[1] = endMoveHint;
}
else
{
hints[0] = endMoveHint;
hints[1] = startMoveHint;
}
}
else
{
if (startMoveHint != null)
{
hints[0] = startMoveHint;
}
else
{
hints[0] = endMoveHint;
}
}
return hints;
}