Copilot commented on code in PR #13041:
URL: https://github.com/apache/trafficserver/pull/13041#discussion_r3012435319


##########
src/proxy/http/HttpSM.cc:
##########
@@ -423,7 +423,8 @@ HttpSM::attach_client_session(ProxyTransaction *txn)
   if (!netvc) {
     return;
   }
-  ATS_PROBE2(http_attach_client_session, sm_id, netvc->get_socket());
+  ATS_PROBE4(http_attach_client_session, sm_id, netvc->get_socket(), 
txn->get_transaction_id(),
+             dynamic_cast<UnixNetVConnection *>(netvc) ? 
dynamic_cast<UnixNetVConnection *>(netvc)->id : 0);

Review Comment:
   The 4th probe argument repeats the same dynamic_cast twice, which is 
unnecessary work (when probes are enabled) and makes the probe call harder to 
read. Consider storing the cast result in a local `UnixNetVConnection *` (or 
`auto *`) and passing `unix_vc ? unix_vc->id : 0` as the last argument.
   ```suggestion
     auto *unix_vc = dynamic_cast<UnixNetVConnection *>(netvc);
     ATS_PROBE4(http_attach_client_session, sm_id, netvc->get_socket(), 
txn->get_transaction_id(),
                unix_vc ? unix_vc->id : 0);
   ```



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