@Override public void execute(MetricTimeSeries timeSeries,FunctionValueMap functionValueMap){
  if (timeSeries.isEmpty()) {
    return;
  }
  timeSeries.sort();
  LongList timeList=new LongList(timeSeries.size());
  DoubleList valueList=new DoubleList(timeSeries.size());
  Set<Double> distinct=new HashSet<>();
  for (int i=0; i < timeSeries.size(); i++) {
    double value=timeSeries.getValue(i);
    if (!distinct.contains(value)) {
      timeList.add(timeSeries.getTime(i));
      valueList.add(value);
      distinct.add(value);
    }
  }
  timeSeries.clear();
  timeSeries.addAll(timeList,valueList);
  functionValueMap.add(this);
}

@ Override public void execute ( MetricTimeSeries timeSeries , FunctionValueMap functionValueMap ) { if ( timeSeries . isEmpty ( ) ) { return ; } timeSeries . sort ( ) ; LongList timeList = new LongList ( timeSeries . size ( ) ) ; DoubleList valueList = new DoubleList ( timeSeries . size ( ) ) ; Set < Double > distinct = new HashSet < > ( ) ; for ( int i = 0 ; i < timeSeries . size ( ) ; i ++ ) { double value = timeSeries . getValue ( i ) ; if ( ! distinct . contains ( value ) ) { timeList . add ( timeSeries . getTime ( i ) ) ; valueList . add ( value ) ; distinct . add ( value ) ; } } timeSeries . clear ( ) ; timeSeries . addAll ( timeList , valueList ) ; functionValueMap . add ( this ) ; }
transforms a time series into a representation with distinct values . the distinct operation uses the first occurrence of a point .
