mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
[core] Use StringRef for get_comment and get_compilation_time to avoid allocations
This commit is contained in:
@@ -257,7 +257,7 @@ class Application {
|
||||
/// Get the comment of this Application set by pre_setup().
|
||||
std::string get_comment() const { return this->comment_; }
|
||||
/// Get the comment as StringRef (avoids allocation)
|
||||
StringRef get_comment_ref() const { return StringRef::from_maybe_nullptr(this->comment_); }
|
||||
StringRef get_comment_ref() const { return StringRef(this->comment_); }
|
||||
|
||||
bool is_name_add_mac_suffix_enabled() const { return this->name_add_mac_suffix_; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user