Skip to content

Commit 12cca65

Browse files
committed
Reintroduce early exit shortcut to detectSortCaseSensitivity
1 parent e60cb49 commit 12cca65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compiler/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ export function detectSortCaseSensitivity<T>(
875875
if (array.length < 2) return kind;
876876

877877
let prevElement = getString(array[0]);
878-
for (let i = 1, len = array.length; i < len; i++) {
878+
for (let i = 1, len = array.length; i < len && kind !== SortKind.None; i++) {
879879
const element = getString(array[i]);
880880
if (kind & SortKind.CaseSensitive && compareStringsCaseSensitive(prevElement, element) > 0) {
881881
kind &= ~SortKind.CaseSensitive;

0 commit comments

Comments
 (0)