🐛 forgot to resize to 0 of string cache

This commit is contained in:
EntireTwix 2021-07-29 20:57:03 -07:00
parent 96d3c1de08
commit b3cc2b2cb5

View file

@ -14,6 +14,7 @@ std::string Log::GetLogs() noexcept
{ {
if (log_flag.GetChangeState() && data.size()) //if there are changes if (log_flag.GetChangeState() && data.size()) //if there are changes
{ {
log_snapshot.resize(0);
//re-generate snapshot //re-generate snapshot
size_t predicted_size = ((59 + (2 * max_name_size)) * data.size()) + 1; size_t predicted_size = ((59 + (2 * max_name_size)) * data.size()) + 1;
if (log_snapshot.capacity() < predicted_size) if (log_snapshot.capacity() < predicted_size)