Browse Source

Remove checking position equality when sorting ranges of selected table cells.

Maciej Gołaszewski 5 years ago
parent
commit
99e8d8b6a7
1 changed files with 3 additions and 4 deletions
  1. 3 4
      packages/ckeditor5-table/src/utils.js

+ 3 - 4
packages/ckeditor5-table/src/utils.js

@@ -167,9 +167,8 @@ function compareRangeOrder( rangeA, rangeB ) {
 	const posA = rangeA.start;
 	const posB = rangeB.start;
 
-	if ( posA.isEqual( posB ) ) {
-		return 0;
-	}
-
+	// Checking for equal position (returning 0) is not needed because this would be either:
+	// a. Intersecting range (not allowed by model)
+	// b. Collapsed range on the same position (allowed by model but should not happen).
 	return posA.isBefore( posB ) ? -1 : 1;
 }