mirror of
https://github.com/esphome/esphome.git
synced 2026-08-22 22:26:21 +00:00
[core] Inline the ESPTime::strftime std::string overload
This commit is contained in:
@@ -114,8 +114,6 @@ std::string ESPTime::strftime(const char *format) {
|
||||
return std::string(buf, len);
|
||||
}
|
||||
|
||||
std::string ESPTime::strftime(const std::string &format) { return this->strftime(format.c_str()); }
|
||||
|
||||
// Helper to parse exactly N digits, returns false if not enough digits
|
||||
static bool parse_digits(const char *&p, const char *end, int count, uint16_t &value) {
|
||||
value = 0;
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ struct ESPTime {
|
||||
* @warning This method can return "ERROR" when the underlying strftime() call fails or when the
|
||||
* output exceeds STRFTIME_BUFFER_SIZE bytes.
|
||||
*/
|
||||
std::string strftime(const std::string &format);
|
||||
std::string strftime(const std::string &format) { return this->strftime(format.c_str()); }
|
||||
|
||||
/// @copydoc strftime(const std::string &format)
|
||||
std::string strftime(const char *format);
|
||||
|
||||
Reference in New Issue
Block a user