Change "pretending to be for loop" while loop to for loop

This commit is contained in:
Riyyi
2021-03-07 01:04:41 +01:00
parent 25a5e0a8e8
commit 571403c9a2
2 changed files with 2 additions and 5 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ namespace Inferno {
// ----------- // -----------
// 0b100000000 256 // 0b100000000 256
// Buffer is is chunks of 128 bytes // Buffer is increased in chunks of 128 bytes
size_t newCapacity = (m_count + bytes + BUFFER_SIZE - 1) & ~(BUFFER_SIZE - 1); size_t newCapacity = (m_count + bytes + BUFFER_SIZE - 1) & ~(BUFFER_SIZE - 1);
unsigned char* newBuffer = static_cast<unsigned char*>(malloc(newCapacity)); unsigned char* newBuffer = static_cast<unsigned char*>(malloc(newCapacity));
+1 -4
View File
@@ -205,16 +205,13 @@ namespace Inferno {
{ {
std::string_view view { format }; std::string_view view { format };
uint32_t i = 0; for(uint32_t i = 0; format[i] != '\0'; i++) {
while(format[i] != '\0') {
if (format[i] == '{' && format[i + 1] == '}') { if (format[i] == '{' && format[i + 1] == '}') {
DebugLogStream(type, false) << view.substr(0, i) << value; DebugLogStream(type, false) << view.substr(0, i) << value;
dbgln(type, newline, format + i + 2, parameters...); dbgln(type, newline, format + i + 2, parameters...);
return; return;
} }
i++;
} }
} }