Skip to content

Commit 3a93340

Browse files
committed
Branch just the once
1 parent 89d21c8 commit 3a93340

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

utils/pg-sql2/src/index.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,11 +1062,19 @@ export function arraysMatch<T>(
10621062
if (l !== array2.length) {
10631063
return false;
10641064
}
1065-
for (let i = 0; i < l; i++) {
1066-
const a = array1[i]!;
1067-
const b = array2[i]!;
1068-
if (a !== b && (!comparator || !comparator(a, b))) {
1069-
return false;
1065+
if (comparator != null) {
1066+
for (let i = 0; i < l; i++) {
1067+
const a = array1[i]!;
1068+
const b = array2[i]!;
1069+
if (a !== b && !comparator(a, b)) {
1070+
return false;
1071+
}
1072+
}
1073+
} else {
1074+
for (let i = 0; i < l; i++) {
1075+
if (array1[i]! !== array2[i]!) {
1076+
return false;
1077+
}
10701078
}
10711079
}
10721080
return true;

0 commit comments

Comments
 (0)