mirror of
https://github.com/java-diff-utils/java-diff-utils.git
synced 2026-03-13 10:11:17 +08:00
Use List.sort instead of Collections.sort
Signed-off-by: Stephen Kitt <skitt@redhat.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user