🐛 correcting last commit

This commit is contained in:
EntireTwix 2023-01-12 13:27:53 -08:00
parent 511aa76795
commit af551ef8b4

View file

@ -82,7 +82,7 @@ std::string Log::GetLogsRange(size_t start, size_t length) noexcept
if (start > data.size()) { return "[]"; }
if (start == 0 && length == MAX_LOG_SIZE) { return log_snapshot_v2; }
if (log_flag_v2.GetChangeState() && data.size()) { GetLogsV2(); }
if (length > data.size()) { length = data.size() - start; }
if ((start + length + 1) >= data.size()) { length = data.size() - start; }
size_t log_index_n = 0, i = 0;
while(i < log_snapshot_v2.size())
@ -97,7 +97,7 @@ std::string Log::GetLogsRange(size_t start, size_t length) noexcept
++log_index_n;
}
size_t log_index_m = log_snapshot_v2.size() - log_index_n;
if ((start + length + 1) != MAX_LOG_SIZE)
if ((start + length + 1) != data.size())
{
log_index_m = 0;
while(i < log_snapshot_v2.size())