소스 검색

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

Maciej Gołaszewski 5 년 전
부모
커밋
99e8d8b6a7
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  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;
 }