(typ *super.TypeRecord, container scode.Bytes, idx int)
| 631 | } |
| 632 | |
| 633 | func getNthFromRecord(typ *super.TypeRecord, container scode.Bytes, idx int) (scode.Bytes, int) { |
| 634 | if idx < 0 { |
| 635 | idx += len(typ.Fields) |
| 636 | if idx < 0 || idx >= len(typ.Fields) { |
| 637 | return nil, -1 |
| 638 | } |
| 639 | } |
| 640 | it := scode.NewRecordIter(container, typ.Opts) |
| 641 | for i := 0; !it.Done(); i++ { |
| 642 | elem, none := it.Next(typ.Fields[i].Opt) |
| 643 | if i == idx { |
| 644 | if none { |
| 645 | return nil, -1 |
| 646 | } |
| 647 | return elem, idx |
| 648 | } |
| 649 | } |
| 650 | return nil, -1 |
| 651 | } |
| 652 | |
| 653 | func lookupKey(mapBytes, target scode.Bytes) (scode.Bytes, bool) { |
| 654 | for it := mapBytes.Iter(); !it.Done(); { |
no test coverage detected