diff --git a/lib/src/Utilities.cc b/lib/src/Utilities.cc index ea68c056b6..0d9f23e9cb 100644 --- a/lib/src/Utilities.cc +++ b/lib/src/Utilities.cc @@ -1344,9 +1344,9 @@ std::string secureRandomString(size_t size) // batch up to 32 bytes of random data for efficiency. Calling // secureRandomBytes can be expensive. + thread_local trantor::utils::Hash256 hash; + thread_local size_t i = 0; auto randByte = []() { - thread_local trantor::utils::Hash256 hash; - thread_local size_t i = 0; if (i == 0) { bool ok = trantor::utils::secureRandomBytes(&hash, sizeof(hash));