refactor(date): Use cpp string comparison

This commit is contained in:
patrick96 2017-09-16 00:09:26 +02:00
parent 0024e1e9e7
commit b6a2c575fd
No known key found for this signature in database
GPG Key ID: 521E5E03AEBCA1A7

View File

@ -53,10 +53,7 @@ namespace modules {
datetime_stream << std::put_time(localtime(&time), time_format.c_str());
auto time_string = datetime_stream.str();
bool date_changed{strncmp(date_string.c_str(), m_date.c_str(), sizeof(date_string)) != 0};
bool time_changed{strncmp(time_string.c_str(), m_time.c_str(), sizeof(time_string)) != 0};
if (!date_changed && !time_changed) {
if (m_date == date_string && m_time == time_string) {
return false;
}