mirror of
https://github.com/esphome/esphome.git
synced 2025-09-25 06:32:22 +01:00
Optimize logger performance by eliminating redundant strlen calls (#9369)
This commit is contained in:
@@ -355,7 +355,7 @@ class Logger : public Component {
|
||||
}
|
||||
|
||||
inline void HOT write_footer_to_buffer_(char *buffer, uint16_t *buffer_at, uint16_t buffer_size) {
|
||||
static const uint16_t RESET_COLOR_LEN = strlen(ESPHOME_LOG_RESET_COLOR);
|
||||
static constexpr uint16_t RESET_COLOR_LEN = sizeof(ESPHOME_LOG_RESET_COLOR) - 1;
|
||||
this->write_body_to_buffer_(ESPHOME_LOG_RESET_COLOR, RESET_COLOR_LEN, buffer, buffer_at, buffer_size);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user