Commit d85d9e5
refactor(testing): hoist codec dispatch tables out of run() (#911)
Two codec fixtures rebuilt a constant lookup table on every call.
The peer-identifier fixture rebuilt a string-to-enum map each run, even
though the literal key-type values already match the enum member names.
Look the member up directly by name instead, dropping the map.
The decode-failure fixture rebuilt its decoder table each call.
Hoist it to a module-level constant so it is built once.
Both fixtures emit byte-identical vectors: the enum lookup yields the same
members as the map, and the decoder table holds the same callables.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent bb1d020 commit d85d9e5
1 file changed
Lines changed: 17 additions & 18 deletions
Lines changed: 17 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
558 | 559 | | |
559 | 560 | | |
560 | 561 | | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
| 562 | + | |
567 | 563 | | |
568 | | - | |
| 564 | + | |
569 | 565 | | |
570 | 566 | | |
571 | 567 | | |
| |||
661 | 657 | | |
662 | 658 | | |
663 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
664 | 672 | | |
665 | 673 | | |
666 | 674 | | |
| |||
683 | 691 | | |
684 | 692 | | |
685 | 693 | | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | 694 | | |
696 | | - | |
| 695 | + | |
697 | 696 | | |
698 | 697 | | |
699 | 698 | | |
| |||
0 commit comments