removed var

This commit is contained in:
William Katz 2021-06-06 16:54:49 -07:00 committed by GitHub
parent 0947ad9b93
commit a4ffee5992
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,16 +36,14 @@ struct User
{
if (log_j.size())
{
uint32_t newLogSize = std::min(pre_log_size * ((log_j.size() / pre_log_size) + 1), max_log_size);
log.data.reserve(newLogSize);
log.data.reserve(std::min(pre_log_size * ((log_j.size() / pre_log_size) + 1), max_log_size));
for (uint32_t i = (log_j.size() - max_log_size) * (log_j.size() > max_log_size); i < log_j.size(); i++)
{
log.data.push_back(std::move(Transaction( // Push back because `i` is not at the beginning
log_j[i]["from"].asCString(), // and no array creation with `vector::resize()`
log.data.push_back(std::move(Transaction(
log_j[i]["from"].asCString(),
log_j[i]["to"].asCString(),
log_j[i]["amount"].asUInt(),
log_j[i]["time"].asUInt64()
)));
log_j[i]["time"].asUInt64())));
}
}
}