[core] Use StringRef for get_comment and get_compilation_time to avoid allocations

This commit is contained in:
J. Nick Koston
2025-11-30 22:44:30 -06:00
parent 4dbe0dab51
commit de6b20d495
+1 -1
View File
@@ -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_; }