mirror of
https://github.com/avast/retdec.git
synced 2025-02-21 06:10:34 +00:00
utils: Improve the return value of timestampToDate().
When constructing the empty string, it is better to use `std::string()` (or just `{}` when returning a value) instead of `""` as the latter calls a construct that needs to traverse the empty string literal, which is needless pessimization.
This commit is contained in:
parent
2305ce083d
commit
2efdb12a58
@ -87,7 +87,7 @@ std::string getCurrentYear() {
|
||||
*/
|
||||
std::string timestampToDate(std::tm *tm) {
|
||||
if (tm == nullptr) {
|
||||
return "";
|
||||
return {};
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
|
Loading…
x
Reference in New Issue
Block a user