1
0
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:
J. Nick Koston
2025-10-02 13:18:19 +02:00
parent 772450f1b3
commit a4cb14a76a

View File

@@ -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)