Skip to content

Commit 0196ed4

Browse files
committed
fix(group): fix incorrect grouping
1 parent 14b1dd2 commit 0196ed4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,11 @@ export function keyByFn<T>(f: (element: T) => string): (array: ArrayLike<T>) =>
387387
export function group<T>(array: ArrayLike<T>, compare: Comparator<T>): T[][] {
388388
const result: T[][] = [];
389389

390-
for (let i = 0; i < array.length; ++i) {
390+
outer: for (let i = 0; i < array.length; ++i) {
391391
for (let j = 0; j < result.length; ++j) {
392392
if (compare(result[j][0], array[i]) === Comparison.equal) {
393393
result[j].push(array[i]);
394-
break;
394+
continue outer;
395395
}
396396
}
397397

0 commit comments

Comments
 (0)