Skip to content

Commit c6e5b1f

Browse files
authored
chore: fix inconsistent comment for dividePoint() (#769)
1 parent df661e9 commit c6e5b1f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

types/validator_set.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ func init() {
834834
divider.Add(divider, big.NewInt(1))
835835
}
836836

837-
// dividePoint computes x÷(MaxUint64+1)×y without overflow for uint64. it returns a value in the [0, y) range when x≠0.
837+
// dividePoint computes and returns the value in the [0, y) range when x≠0.
838838
// Otherwise returns 0.
839839
func dividePoint(x uint64, y int64) uint64 {
840840
totalBig := big.NewInt(y)
@@ -847,10 +847,10 @@ func dividePoint(x uint64, y int64) uint64 {
847847
// nextRandom implements SplitMix64 (based on http://xoshiro.di.unimi.it/splitmix64.c)
848848
//
849849
// The PRNG used for this random selection:
850-
// 1. must be deterministic.
851-
// 2. should easily portable, independent of language or library
852-
// 3. is not necessary to keep a long period like MT, since there aren't many random numbers to generate and
853-
// we expect a certain amount of randomness in the seed.
850+
// 1. must be deterministic.
851+
// 2. should easily portable, independent of language or library
852+
// 3. is not necessary to keep a long period like MT, since there aren't many random numbers to generate and
853+
// we expect a certain amount of randomness in the seed.
854854
//
855855
// The shift-register type pRNG fits these requirements well, but there are too many variants. So we adopted SplitMix64,
856856
// which is used in Java's SplittableStream.

0 commit comments

Comments
 (0)