| 154 | } |
| 155 | |
| 156 | fl::string Channel::makeName(i32 id, const fl::optional<fl::string>& configName) { |
| 157 | if (configName.has_value()) { |
| 158 | return configName.value(); |
| 159 | } |
| 160 | // Auto-naming `"Channel_<id>"` only matters for diagnostics — in release |
| 161 | // builds (NDEBUG → FASTLED_LOG_VERBOSITY=0 per Stage 1) every FL_WARN / |
| 162 | // FL_ERROR site that reads mName collapses to `do { } while(0)`, so the |
| 163 | // string and the supporting `fl::to_string` + `operator+` chain go |
| 164 | // unused. Empty in release saves the `fl::to_string<i64>` instantiation |
| 165 | // plus the heap allocation per Channel ctor. See #2942 / #2886. |
| 166 | #if FASTLED_LOG_RUNTIME_ENABLED |
| 167 | return "Channel_" + fl::to_string(static_cast<i64>(id)); |
| 168 | #else |
| 169 | (void)id; |
| 170 | return {}; |
| 171 | #endif |
| 172 | } |
| 173 | |
| 174 | ChannelPtr Channel::create(const ChannelConfig &config) { |
| 175 | // Late binding strategy: Always create with empty driver |