mirror of
https://github.com/esphome/esphome.git
synced 2025-07-28 14:16:40 +00:00
Mark ESPTime comparison operators as const (#9335)
This commit is contained in:
parent
4e9e48e2e7
commit
b0f8922056
@ -226,11 +226,11 @@ int32_t ESPTime::timezone_offset() {
|
||||
return offset;
|
||||
}
|
||||
|
||||
bool ESPTime::operator<(ESPTime other) { return this->timestamp < other.timestamp; }
|
||||
bool ESPTime::operator<=(ESPTime other) { return this->timestamp <= other.timestamp; }
|
||||
bool ESPTime::operator==(ESPTime other) { return this->timestamp == other.timestamp; }
|
||||
bool ESPTime::operator>=(ESPTime other) { return this->timestamp >= other.timestamp; }
|
||||
bool ESPTime::operator>(ESPTime other) { return this->timestamp > other.timestamp; }
|
||||
bool ESPTime::operator<(const ESPTime &other) const { return this->timestamp < other.timestamp; }
|
||||
bool ESPTime::operator<=(const ESPTime &other) const { return this->timestamp <= other.timestamp; }
|
||||
bool ESPTime::operator==(const ESPTime &other) const { return this->timestamp == other.timestamp; }
|
||||
bool ESPTime::operator>=(const ESPTime &other) const { return this->timestamp >= other.timestamp; }
|
||||
bool ESPTime::operator>(const ESPTime &other) const { return this->timestamp > other.timestamp; }
|
||||
|
||||
template<typename T> bool increment_time_value(T ¤t, uint16_t begin, uint16_t end) {
|
||||
current++;
|
||||
|
@ -109,10 +109,10 @@ struct ESPTime {
|
||||
void increment_second();
|
||||
/// Increment this clock instance by one day.
|
||||
void increment_day();
|
||||
bool operator<(ESPTime other);
|
||||
bool operator<=(ESPTime other);
|
||||
bool operator==(ESPTime other);
|
||||
bool operator>=(ESPTime other);
|
||||
bool operator>(ESPTime other);
|
||||
bool operator<(const ESPTime &other) const;
|
||||
bool operator<=(const ESPTime &other) const;
|
||||
bool operator==(const ESPTime &other) const;
|
||||
bool operator>=(const ESPTime &other) const;
|
||||
bool operator>(const ESPTime &other) const;
|
||||
};
|
||||
} // namespace esphome
|
||||
|
Loading…
x
Reference in New Issue
Block a user