Skip to content

Commit 8916c20

Browse files
simplify group code
1 parent 5709132 commit 8916c20

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/map/group.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export function* group ( key , iterable ) {
2828
let currval = first.value ;
2929
let currkey = key( currval ) ;
3030

31-
let tgtkey ;
32-
33-
const grouper = function* ( ) {
31+
const grouper = function* ( tgtkey ) {
3432

3533
while ( true ) {
3634

@@ -50,9 +48,9 @@ export function* group ( key , iterable ) {
5048

5149
while ( true ) {
5250

53-
tgtkey = currkey ;
51+
const tgtkey = currkey ;
5452

55-
const g = grouper( ) ;
53+
const g = grouper( tgtkey ) ;
5654

5755
yield [ tgtkey , g ] ;
5856

0 commit comments

Comments
 (0)