nickva commented on a change in pull request #1798: Suppress compiler warnings
URL: https://github.com/apache/couchdb/pull/1798#discussion_r239696867
##########
File path: src/mem3/src/mem3.erl
##########
@@ -196,7 +196,7 @@ choose_shards(DbName, Nodes, Options) ->
Q = mem3_util:q_val(couch_util:get_value(q, Options,
config:get("cluster", "q", "8"))),
%% rotate to a random entry in the nodelist for even distribution
- {A, B} = lists:split(crypto:rand_uniform(1,length(Nodes)+1), Nodes),
+ {A, B} = lists:split(couch_rand:uniform(length(Nodes)+1), Nodes),
Review comment:
Note that `couch_rand:uniform(N)` has a `[1, N]` range, while
`crypto:rand_uniform(1, N)` has `[1, N)` so we'd want to subtract 1 as in
`...(couch_rand:uniform(length(Nodes))...`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services