From 2687763a5fcbd72ddff8bf0062928982b3cf8289 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 21 Sep 2022 04:43:52 +0800 Subject: [PATCH] update --- server/hasher.h | 2 +- server/io.cpp | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/server/hasher.h b/server/hasher.h index 2de5555..2bfe3d1 100644 --- a/server/hasher.h +++ b/server/hasher.h @@ -58,7 +58,7 @@ inline size_t append_bytes(const astring_view& view) noexcept { template struct hasher { template typename std::enable_if< i == sizeof...(Types), - size_t>::type hashi(const std::tuple& record) const { + size_t>::type hashi(const std::tuple&) const { return 534235245539ULL; } diff --git a/server/io.cpp b/server/io.cpp index c34dc42..107829b 100644 --- a/server/io.cpp +++ b/server/io.cpp @@ -16,8 +16,10 @@ void setgbuf(char* buf) { static char* b = 0; if (buf == 0) gbuf = b; - else + else { gbuf = buf; + b = buf; + } } #ifdef __AQ__HAS__INT128__ @@ -246,10 +248,13 @@ std::ostream& operator<<(std::ostream& os, types::timestamp_t & v) using std::string; string base62uuid(int l) { using namespace std; - constexpr static const char* base62alp = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - static mt19937_64 engine(chrono::system_clock::now().time_since_epoch().count()); + constexpr static const char* base62alp = + "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + static mt19937_64 engine( + chrono::system_clock::now().time_since_epoch().count()); static uniform_int_distribution u(0x10000, 0xfffff); - uint64_t uuid = (u(engine) << 32ull) + (chrono::system_clock::now().time_since_epoch().count() & 0xffffffff); + uint64_t uuid = (u(engine) << 32ull) + + (chrono::system_clock::now().time_since_epoch().count() & 0xffffffff); //printf("%llu\n", uuid); string ret; while (uuid && l-- >= 0) {