[light] Return StringRef from LightEffect::get_name() and LightState::get_effect_name() (#13105)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2026-01-11 17:52:39 -10:00
1 parent 23f9f70b71
commit f1b11b1855
13 files changed
+97 -36

No files matched your search

+3
View File
@@ -162,6 +162,9 @@ float random_float() { return static_cast<float>(random_uint32()) / static_cast<
bool str_equals_case_insensitive(const std::string &a, const std::string &b) {
return strcasecmp(a.c_str(), b.c_str()) == 0;
}
bool str_equals_case_insensitive(StringRef a, StringRef b) {
return a.size() == b.size() && strncasecmp(a.c_str(), b.c_str(), a.size()) == 0;
}
#if __cplusplus >= 202002L
bool str_startswith(const std::string &str, const std::string &start) { return str.starts_with(start); }
bool str_endswith(const std::string &str, const std::string &end) { return str.ends_with(end); }