mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Speed up the random number generation
This commit is contained in:
parent
45638ccc91
commit
bb30d42b57
@ -87,10 +87,10 @@ std::vector<std::string> split(std::string str, char delimiter) {
|
|||||||
|
|
||||||
|
|
||||||
double random_number(const double from, const double to) {
|
double random_number(const double from, const double to) {
|
||||||
std::random_device rd;
|
std::mt19937 mt(time(0));
|
||||||
return std::bind(
|
return std::bind(
|
||||||
std::uniform_real_distribution<>{from, to},
|
std::uniform_real_distribution<>{from, to},
|
||||||
std::default_random_engine{ rd() })();
|
std::default_random_engine{ mt() })();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user