ywkaras commented on a change in pull request #7079:
URL: https://github.com/apache/trafficserver/pull/7079#discussion_r464771049
##########
File path: iocore/net/quic/qlog/QLog.h
##########
@@ -46,9 +46,13 @@ class Trace
VantagePointType flow = VantagePointType::unknown;
};
- Trace(std::string odcid, std::string title = "", std::string desc = "") :
_reference_time(Thread::get_hrtime()), _odcid(odcid) {}
+ Trace(const std::string &odcid, const std::string &title = "", const
std::string &desc = "")
Review comment:
When you use the defaults for the last 2 parameters, the compiler will
have to generate temporary strings and pass their addresses, like in this
example: https://godbolt.org/z/s976ce . Surprisingly, the optimizer is not
smart enough to reuse the temporary, even within the small function g() . So
you may want to create your own named empty string as the default value for the
parameter, similar to S::Default in the example.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]