remove std::make_pair

make_pair is an old C++98 function that can be replaced by modern
shorter constructs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2021-09-07 20:58:23 -07:00
parent 15f419e1cb
commit 6ec5089cc9
10 changed files with 15 additions and 18 deletions

View File

@@ -68,7 +68,7 @@ ParseTimeZoneOffsetRaw(const char *&s)
unsigned long value = std::strtoul(s, &endptr, 10);
if (endptr == s + 4) {
s = endptr;
return std::make_pair(value / 100, value % 100);
return {value / 100, value % 100};
} else if (endptr == s + 2) {
s = endptr;
@@ -82,7 +82,7 @@ ParseTimeZoneOffsetRaw(const char *&s)
s = endptr;
}
return std::make_pair(hours, minutes);
return {hours, minutes};
} else
throw std::invalid_argument("Failed to parse time zone offset");
}
@@ -234,6 +234,6 @@ ParseISO8601(const char *s)
if (*s != 0)
throw std::invalid_argument("Garbage at end of time stamp");
return std::make_pair(tp, precision);
return {tp, precision};
#endif /* !_WIN32 */
}