Browse Source

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

master
Riyyi 3 years ago
parent
commit
571403c9a2
  1. 2
      inferno/src/inferno/io/log.cpp
  2. 5
      inferno/src/inferno/io/log.h

2
inferno/src/inferno/io/log.cpp

@ -29,7 +29,7 @@ namespace Inferno {
// -----------
// 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);
unsigned char* newBuffer = static_cast<unsigned char*>(malloc(newCapacity));

5
inferno/src/inferno/io/log.h

@ -205,16 +205,13 @@ namespace Inferno {
{
std::string_view view { format };
uint32_t i = 0;
while(format[i] != '\0') {
for(uint32_t i = 0; format[i] != '\0'; i++) {
if (format[i] == '{' && format[i + 1] == '}') {
DebugLogStream(type, false) << view.substr(0, i) << value;
dbgln(type, newline, format + i + 2, parameters...);
return;
}
i++;
}
}

Loading…
Cancel
Save