mirror of
https://github.com/esphome/esphome.git
synced 2025-01-05 20:31:44 +01:00
parent
39f3f795e2
commit
e3d673d16c
2 changed files with 3 additions and 3 deletions
|
@ -293,7 +293,7 @@ std::string str_sanitize(const std::string &str) {
|
|||
std::replace_if(
|
||||
out.begin(), out.end(),
|
||||
[](const char &c) {
|
||||
return !(c == '-' || c == '_' || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
|
||||
return c != '-' && c != '_' && (c < '0' || c > '9') && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z');
|
||||
},
|
||||
'_');
|
||||
return out;
|
||||
|
|
|
@ -59,7 +59,7 @@ template<typename T> class optional { // NOLINT
|
|||
return *this;
|
||||
}
|
||||
|
||||
void swap(optional &rhs) {
|
||||
void swap(optional &rhs) noexcept {
|
||||
using std::swap;
|
||||
if (has_value() && rhs.has_value()) {
|
||||
swap(**this, *rhs);
|
||||
|
@ -206,7 +206,7 @@ template<typename T, typename U> inline bool operator>=(U const &v, optional<T>
|
|||
|
||||
// Specialized algorithms
|
||||
|
||||
template<typename T> void swap(optional<T> &x, optional<T> &y) { x.swap(y); }
|
||||
template<typename T> void swap(optional<T> &x, optional<T> &y) noexcept { x.swap(y); }
|
||||
|
||||
// Convenience function to create an optional.
|
||||
|
||||
|
|
Loading…
Reference in a new issue