mirror of
https://github.com/KjellKod/g3log.git
synced 2025-01-19 08:46:42 +01:00
Performance fix: g2time return string without unnecessary (old) stream buffering
This commit is contained in:
parent
1ac2e9070e
commit
9f015b4216
@ -76,8 +76,6 @@ namespace g2 {
|
||||
|
||||
std::string localtime_formatted(const std::time_t& time_snapshot, const std::string& time_format) {
|
||||
std::tm t = localtime(time_snapshot); // could be const, but cannot due to VS2012 is non conformant for C++11's std::put_time (see above)
|
||||
std::stringstream buffer;
|
||||
buffer << g2::internal::put_time(&t, time_format.c_str()); // format example: //"%Y/%m/%d %H:%M:%S");
|
||||
return buffer.str();
|
||||
return g2::internal::put_time(&t, time_format.c_str()); // format example: //"%Y/%m/%d %H:%M:%S");
|
||||
}
|
||||
} // g2
|
||||
|
Loading…
x
Reference in New Issue
Block a user