[select] Return StringRef from current_option() (#13095)
This commit is contained in:
1 parent
eeeae53f76
commit
23f9f70b71
12 files changed
+68
-23
No files matched your search
@@ -38,7 +38,9 @@ void Select::publish_state(size_t index) {
|
||||
#endif
|
||||
}
|
||||
|
||||
const char *Select::current_option() const { return this->has_state() ? this->option_at(this->active_index_) : ""; }
|
||||
StringRef Select::current_option() const {
|
||||
return this->has_state() ? StringRef(this->option_at(this->active_index_)) : StringRef();
|
||||
}
|
||||
|
||||
void Select::add_on_state_callback(std::function<void(size_t)> &&callback) {
|
||||
this->state_callback_.add(std::move(callback));
|
||||
|
||||
Reference in new issue
Block a user