@@ -344,16 +344,16 @@ type _tupleIteratorRepr struct {
344
344
}
345
345
346
346
func (w * _tupleIteratorRepr ) Next () (index int64 , value datamodel.Node , _ error ) {
347
- _skipAbsent:
348
- idx := w .nextIndex
349
- _ , value , err := (* _structIterator )(w ).Next ()
350
- if err != nil {
351
- return 0 , nil , err
352
- }
353
- if w .nextIndex > w .reprEnd {
354
- goto _skipAbsent
347
+ for {
348
+ idx := w .nextIndex
349
+ _ , value , err := (* _structIterator )(w ).Next ()
350
+ if err != nil {
351
+ return 0 , nil , err
352
+ }
353
+ if w .nextIndex <= w .reprEnd {
354
+ return int64 (idx ), reprNode (value ), nil
355
+ }
355
356
}
356
- return int64 (idx ), reprNode (value ), nil
357
357
}
358
358
359
359
func (w * _tupleIteratorRepr ) Done () bool {
@@ -372,23 +372,24 @@ type _listpairsIteratorRepr struct {
372
372
}
373
373
374
374
func (w * _listpairsIteratorRepr ) Next () (index int64 , value datamodel.Node , _ error ) {
375
- _skipAbsent:
376
- if w .Done () {
377
- return 0 , nil , datamodel.ErrIteratorOverread {}
378
- }
379
- idx := w .nextIndex
380
- key , value , err := (* _structIterator )(w ).Next ()
381
- if err != nil {
382
- return 0 , nil , err
383
- }
384
- if value .IsAbsent () || w .nextIndex > w .reprEnd {
385
- goto _skipAbsent
386
- }
387
- field , err := buildListpairsField (key , value )
388
- if err != nil {
389
- return 0 , nil , err
375
+ for {
376
+ if w .Done () {
377
+ return 0 , nil , datamodel.ErrIteratorOverread {}
378
+ }
379
+ idx := w .nextIndex
380
+ key , value , err := (* _structIterator )(w ).Next ()
381
+ if err != nil {
382
+ return 0 , nil , err
383
+ }
384
+ if value .IsAbsent () || w .nextIndex > w .reprEnd {
385
+ continue
386
+ }
387
+ field , err := buildListpairsField (key , value )
388
+ if err != nil {
389
+ return 0 , nil , err
390
+ }
391
+ return int64 (idx ), field , nil
390
392
}
391
- return int64 (idx ), field , nil
392
393
}
393
394
394
395
func (w * _listpairsIteratorRepr ) Done () bool {
@@ -1257,20 +1258,21 @@ type _structIteratorRepr _structIterator
1257
1258
func (w * _structIteratorRepr ) Next () (key , value datamodel.Node , _ error ) {
1258
1259
switch stg := reprStrategy (w .schemaType ).(type ) {
1259
1260
case schema.StructRepresentation_Map :
1260
- _skipAbsent:
1261
- key , value , err := (* _structIterator )(w ).Next ()
1262
- if err != nil {
1263
- return nil , nil , err
1264
- }
1265
- if value .IsAbsent () {
1266
- goto _skipAbsent
1267
- }
1268
- keyStr , _ := key .AsString ()
1269
- mappedKey := outboundMappedKey (stg , keyStr )
1270
- if mappedKey != keyStr {
1271
- key = basicnode .NewString (mappedKey )
1261
+ for {
1262
+ key , value , err := (* _structIterator )(w ).Next ()
1263
+ if err != nil {
1264
+ return nil , nil , err
1265
+ }
1266
+ if value .IsAbsent () {
1267
+ continue
1268
+ }
1269
+ keyStr , _ := key .AsString ()
1270
+ mappedKey := outboundMappedKey (stg , keyStr )
1271
+ if mappedKey != keyStr {
1272
+ key = basicnode .NewString (mappedKey )
1273
+ }
1274
+ return key , reprNode (value ), nil
1272
1275
}
1273
- return key , reprNode (value ), nil
1274
1276
default :
1275
1277
return nil , nil , fmt .Errorf ("bindnode Next TODO: %T" , stg )
1276
1278
}
0 commit comments