private bool PreferBlockBoundaryIntervalSplit(LiveInterval liveInterval, SlotIndex at, bool addToQueue) { var low = GetLowerOptimalSplitLocation(liveInterval, at); var high = GetUpperOptimalSplitLocation(liveInterval, at); List <LiveInterval> intervals; if (low.IsNull && high.IsNotNull) { if (!liveInterval.LiveRange.CanSplitAt(high)) { return(false); } intervals = liveInterval.SplitAt(high); } else if (high.IsNull && low.IsNotNull) { if (!liveInterval.LiveRange.CanSplitAt(low)) { return(false); } intervals = liveInterval.SplitAt(low); } else if (low.IsNotNull && high.IsNotNull) { if (!liveInterval.LiveRange.CanSplitAt(low, high)) { return(false); } intervals = liveInterval.SplitAt(low, high); } else { return(false); } ReplaceIntervals(liveInterval, intervals, addToQueue); return(true); }
private bool PreferBlockBoundaryIntervalSplit(LiveInterval liveInterval, SlotIndex at, bool addToQueue) { var low = GetLowerOptimalSplitLocation(liveInterval, at); var high = GetUpperOptimalSplitLocation(liveInterval, at); IList<LiveInterval> intervals; if (liveInterval.Start == low) { if (!liveInterval.LiveRange.CanSplitAt(high)) return false; intervals = liveInterval.SplitAt(high); } else if (high == liveInterval.End) { if (!liveInterval.LiveRange.CanSplitAt(low)) return false; intervals = liveInterval.SplitAt(low); } else { if (!liveInterval.LiveRange.CanSplitAt(low, high)) { return false; } intervals = liveInterval.SplitAt(low, high); } ReplaceIntervals(liveInterval, intervals, addToQueue); return true; }