From b6a2c575fdd606388041b5a8adca68cb03f0e260 Mon Sep 17 00:00:00 2001 From: patrick96 Date: Sat, 16 Sep 2017 00:09:26 +0200 Subject: [PATCH] refactor(date): Use cpp string comparison --- src/modules/date.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/modules/date.cpp b/src/modules/date.cpp index d108de39..048605bd 100644 --- a/src/modules/date.cpp +++ b/src/modules/date.cpp @@ -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; }