Fix selection of user's country
This commit is contained in:
parent
b6a80c9b7d
commit
dbf7dfe929
|
@ -49,7 +49,7 @@ impl User {
|
|||
let submits_reports = num < state.prob_user_submits_reports;
|
||||
|
||||
// Probabilistically decide user's country
|
||||
let num: f64 = rng.gen_range(0.0..1.0);
|
||||
let mut num: f64 = rng.gen_range(0.0..1.0);
|
||||
let cc = {
|
||||
let mut cc = String::default();
|
||||
for (country, prob) in &state.probs_user_in_country {
|
||||
|
@ -58,7 +58,7 @@ impl User {
|
|||
cc = country.to_string();
|
||||
break;
|
||||
} else {
|
||||
prob -= num;
|
||||
num -= prob;
|
||||
}
|
||||
}
|
||||
cc
|
||||
|
|
Loading…
Reference in New Issue