From e5302af9583aaec4ba0e23e10c9fbc20a2e0b754 Mon Sep 17 00:00:00 2001 From: EntireTwix Date: Tue, 13 Jul 2021 20:26:36 -0700 Subject: [PATCH] :fire::zap: removed move constructor variant & adjusted to new log structure --- src/user.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/user.cpp b/src/user.cpp index 1abfc5e..6988675 100644 --- a/src/user.cpp +++ b/src/user.cpp @@ -6,7 +6,7 @@ * @param init_bal initial balance * @param init_pass initial password */ -User::User(uint32_t init_bal, std::string &&init_pass) noexcept : balance(init_bal), password(xxHashStringGen{}(init_pass)) {} +User::User(uint32_t init_bal, const std::string &init_pass) noexcept : balance(init_bal), password(xxHashStringGen{}(init_pass)) {} /** * @brief User Constructor for loading @@ -25,16 +25,15 @@ User::User(uint32_t init_bal, XXH64_hash_t init_pass, const Json::Value &log_j) #if MAX_LOG_SIZE == 1 log.data = ( #else - log.data.push_back( + log.data.emplace_back( #endif - Transaction( log_j[i]["from"].asCString(), log_j[i]["to"].asCString(), log_j[i]["amount"].asUInt(), #ifdef _USE_32BIT_TIME_T - log_j[i]["time"].asUInt())); + log_j[i]["time"].asUInt())) #else - log_j[i]["time"].asUInt64())); + log_j[i]["time"].asUInt64()); #endif } }