Skip to content

Commit

Permalink
Use Edit.compareTo to sort index
Browse files Browse the repository at this point in the history
  • Loading branch information
ygormutti committed Jun 28, 2019
1 parent 3cd4b47 commit a5c8029
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions diffless/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export class EditIndex {
changes.push(change);

// sort by level
changes.sort((a, b) => {
return ((a.level * 100) - (b.level * 100)) + (a.operation - b.operation);
});
changes.sort((a, b) => a.compareTo(b));
}

get(position: Position): Edit[] {
Expand Down

0 comments on commit a5c8029

Please sign in to comment.