Commit cd57c4d
committed
(minor improvement): small refactoring in make_token_replica_map()
While trying to look at some random (flaky?) test (#510 (comment) )
I saw some (minor) improvements that can be made to make_token_replica_map():
1. Remove some redundant len() calls to outside the loop(s)
2. Align some variable names, start with num_ ... for them.
3. Move token_offset and host assignment within the loop to closer to where it's used.
All those are probably very very minor improvements, perhaps in a large cluster it'll be noticable.
Signed-off-by: Yaniv Kaul <[email protected]>1 parent 472b679 commit cd57c4d
1 file changed
+11
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
657 | 657 | | |
658 | 658 | | |
659 | 659 | | |
660 | | - | |
| 660 | + | |
661 | 661 | | |
662 | 662 | | |
663 | | - | |
664 | | - | |
| 663 | + | |
| 664 | + | |
665 | 665 | | |
666 | 666 | | |
667 | | - | |
668 | | - | |
| 667 | + | |
| 668 | + | |
669 | 669 | | |
670 | | - | |
671 | | - | |
672 | | - | |
| 670 | + | |
673 | 671 | | |
674 | 672 | | |
| 673 | + | |
| 674 | + | |
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
678 | | - | |
| 678 | + | |
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | | - | |
| 683 | + | |
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
687 | | - | |
| 687 | + | |
688 | 688 | | |
689 | 689 | | |
690 | 690 | | |
| |||
0 commit comments