JosiahWI commented on PR #13470:
URL: https://github.com/apache/trafficserver/pull/13470#issuecomment-5152020471

   Copilot's comment about moving the ternary operand blocking NRVO/copy 
elision is possibly the most interesting dubious comment I've seen from Copilot 
to date. It has low confidence, which is good, because it should. This is a 
very subtle trap in C++: the original ternary expression has an l-value operand 
and an r-value operand, so the ternary expression is actually forced to cause a 
temporary copy of `metric_name` if that branch is taken. Coverity is right - 
this is a special edge case where the `std::move` is actually appropriate.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to