function reformIntervals(list) {
  list.sort(function (a, b) {
    return littleThan(a, b, 0) ? -1 : 1;
  });
  var curr = -Infinity;
  var currClose = 1;

  for (var i = 0; i < list.length;) {
    var interval = list[i].interval;
    var close_1 = list[i].close;

    for (var lg = 0; lg < 2; lg++) {
      if (interval[lg] <= curr) {
        interval[lg] = curr;
        close_1[lg] = !lg ? 1 - currClose : 1;
      }

      curr = interval[lg];
      currClose = close_1[lg];
    }

    if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {
      list.splice(i, 1);
    } else {
      i++;
    }
  }

  return list;

  function littleThan(a, b, lg) {
    return a.interval[lg] < b.interval[lg] || a.interval[lg] === b.interval[lg] && (a.close[lg] - b.close[lg] === (!lg ? 1 : -1) || !lg && littleThan(a, b, 1));
  }
}
Order intervals asc, and split them when overlap.
expect(numberUtil.reformIntervals([
    {interval: [18, 62], close: [1, 1]},
    {interval: [-Infinity, -70], close: [0, 0]},
    {interval: [-70, -26], close: [1, 1]},
    {interval: [-26, 18], close: [1, 1]},
    {interval: [62, 150], close: [1, 1]},
    {interval: [106, 150], close: [1, 1]},
    {interval: [150, Infinity], close: [0, 0]}
])).toEqual([
    {interval: [-Infinity, -70], close: [0, 0]},
    {interval: [-70, -26], close: [1, 1]},
    {interval: [-26, 18], close: [0, 1]},
    {interval: [18, 62], close: [0, 1]},
    {interval: [62, 150], close: [0, 1]},
    {interval: [150, Infinity], close: [0, 0]}
]);
@param list, where `close` mean open or close
       of the interval, and Infinity can be used.
@return The origin list, which has been reformed.