Copilot commented on code in PR #12566:
URL: https://github.com/apache/trafficserver/pull/12566#discussion_r2434089536
##########
plugins/header_rewrite/statement.cc:
##########
@@ -92,29 +87,27 @@ Statement::acquire_txn_slot()
return index;
}();
- _txn_slot = txn_slot_index;
+ return txn_slot_index;
}
-void
+int
Statement::acquire_txn_private_slot()
{
- // Don't do anything if we don't need it
- if (!need_txn_private_slot() || _txn_private_slot >= 0) {
- return;
- }
-
// Only call the index reservation once per plugin load
static int txn_private_slot_index = []() -> int {
- int index = -1;
+ int index = -1;
+ std::string name = PLUGIN_NAME;
+
+ name += "_priv";
Review Comment:
[nitpick] Consider constructing the string in a single expression (e.g.,
`std::string name = std::string(PLUGIN_NAME) + \"_priv\";`) to improve code
clarity and reduce the number of operations.
```suggestion
std::string name = std::string(PLUGIN_NAME) + "_priv";
```
--
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]