Use List.sort instead of Collections.sort

Signed-off-by: Stephen Kitt <skitt@redhat.com>
This commit is contained in:
Stephen Kitt
2019-02-07 19:00:44 +01:00
parent a312ec14ea
commit 765dc29386

View File

@@ -19,12 +19,9 @@ limitations under the License.
*/
package com.github.difflib.patch;
import com.github.difflib.algorithm.Change;
import static com.github.difflib.patch.DeltaType.DELETE;
import static com.github.difflib.patch.DeltaType.INSERT;
import java.util.ArrayList;
import java.util.Collections;
import static java.util.Comparator.comparing;
import com.github.difflib.algorithm.Change;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
@@ -93,7 +90,7 @@ public final class Patch<T> {
* @return the deltas
*/
public List<AbstractDelta<T>> getDeltas() {
Collections.sort(deltas, comparing(d -> d.getSource().getPosition()));
deltas.sort(comparing(d -> d.getSource().getPosition()));
return deltas;
}