Skip to content

Commit

Permalink
typo (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoliwang committed Oct 2, 2022
1 parent 459062d commit 282789f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions channel.go
Expand Up @@ -96,11 +96,11 @@ func DispatchingStrategyRandom[T any](msg T, index uint64, channels []<-chan T)

// DispatchingStrategyRandom distributes messages in a weighted manner.
// If the channel capacity is exceeded, another random channel will be selected and so on.
func DispatchingStrategyWeightedRandom[T any](weigths []int) DispatchingStrategy[T] {
func DispatchingStrategyWeightedRandom[T any](weights []int) DispatchingStrategy[T] {
seq := []int{}

for i := 0; i < len(weigths); i++ {
for j := 0; j < weigths[i]; j++ {
for i := 0; i < len(weights); i++ {
for j := 0; j < weights[i]; j++ {
seq = append(seq, i)
}
}
Expand Down

0 comments on commit 282789f

Please sign in to comment.