Skip to content

Commit

Permalink
(db) tidy-up
Browse files Browse the repository at this point in the history
  • Loading branch information
uatuko committed Nov 19, 2024
1 parent 3ef1052 commit 865fd64
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/db/detail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
namespace db {
namespace detail {
int rand() {
static std::random_device rd;
static std::mt19937 g(rd());
static std::mt19937 g;
static bool seeded = false;

if (!seeded) {
std::random_device rd;
g.seed(rd());

seeded = true;
}

return g();
}
Expand Down

0 comments on commit 865fd64

Please sign in to comment.