16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 01:59:19 +02:00

Change RandomInt to Random overload and reuse global random engine.

This commit is contained in:
docentYT
2026-05-01 00:25:16 +02:00
parent 937d1b2f2a
commit ee3af0bf18
3 changed files with 4 additions and 5 deletions

View File

@@ -100,11 +100,10 @@ double Random(double a, double b)
return dist(Global.random_engine);
}
int RandomInt(int min, int max)
int Random(int min, int max)
{
static std::mt19937 engine(std::random_device{}());
std::uniform_int_distribution<int> dist(min, max);
return dist(engine);
return dist(Global.random_engine);
}
std::string generate_uuid_v4()