mirror of
https://github.com/esphome/esphome.git
synced 2025-10-07 12:23:47 +01:00
Apply Copilot review suggestion: use remainder variable instead of modifying line parameter
This commit is contained in:
@@ -356,11 +356,11 @@ class Logger : public Component {
|
||||
copy_string(buffer, pos, tag);
|
||||
buffer[pos++] = ':';
|
||||
int hundreds = line / 100;
|
||||
line -= hundreds * 100;
|
||||
int tens = line / 10;
|
||||
int remainder = line - hundreds * 100;
|
||||
int tens = remainder / 10;
|
||||
buffer[pos++] = '0' + hundreds;
|
||||
buffer[pos++] = '0' + tens;
|
||||
buffer[pos++] = '0' + (line - tens * 10);
|
||||
buffer[pos++] = '0' + (remainder - tens * 10);
|
||||
buffer[pos++] = ']';
|
||||
|
||||
#if defined(USE_ESP32) || defined(USE_LIBRETINY) || defined(USE_ZEPHYR)
|
||||
|
Reference in New Issue
Block a user