Skip to content

Commit d229e49

Browse files
Fix code style remarks
Relates-To: IOTSDK-24021 Signed-off-by: Mykhailo Diachenko <ext-mykhailo.z.diachenko@here.com>
1 parent be42396 commit d229e49

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

olp-cpp-sdk-authentication/src/AuthenticationClientUtils.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ constexpr auto kDate = "date";
9898

9999
#ifdef _WIN32
100100
// Windows does not have ::strptime and ::timegm
101-
std::time_t doParseTime(const std::string& value) {
101+
std::time_t DoParseTime(const std::string& value) {
102102
std::tm tm = {};
103103
std::istringstream ss(value);
104104
ss >> std::get_time(&tm, "%a, %d %b %Y %H:%M:%S %z");
@@ -107,27 +107,26 @@ std::time_t doParseTime(const std::string& value) {
107107

108108
#else
109109

110-
std::time_t doParseTime(const std::string& value) {
110+
std::time_t DoParseTime(const std::string& value) {
111111
std::tm tm = {};
112-
std::istringstream ss(value);
113112
const auto format = "%a, %d %b %Y %H:%M:%S %Z";
114-
const auto parsedUntil = ::strptime(value.c_str(), format, &tm);
115-
if (parsedUntil != value.c_str() + value.size()) {
113+
const auto parsed_until = ::strptime(value.c_str(), format, &tm);
114+
if (parsed_until != value.c_str() + value.size()) {
116115
OLP_SDK_LOG_WARNING(kLogTag, "Timestamp is not fully parsed" << value);
117116
}
118117
return timegm(&tm);
119118
}
120119

121120
#endif
122121

123-
std::time_t gmtEpochOffset() {
124-
const auto epochAsDateTime = "Thu, 1 Jan 1970 0:00:00 GMT";
125-
return doParseTime(epochAsDateTime);
122+
std::time_t GmtEpochOffset() {
123+
const auto epoch_as_date_time = "Thu, 1 Jan 1970 0:00:00 GMT";
124+
return DoParseTime(epoch_as_date_time);
126125
}
127126

128127
std::time_t ParseTime(const std::string& value) {
129-
const auto time = doParseTime(value);
130-
const auto offset = gmtEpochOffset();
128+
const auto time = DoParseTime(value);
129+
const auto offset = GmtEpochOffset();
131130
return time - offset;
132131
}
133132

0 commit comments

Comments
 (0)