bneradt commented on a change in pull request #7708:
URL: https://github.com/apache/trafficserver/pull/7708#discussion_r614284526
##########
File path: plugins/experimental/parent_select/parent_select.cc
##########
@@ -373,14 +373,13 @@ TSRemapNewInstance(int argc, char *argv[], void **ih,
char *errbuff, int errbuff
std::unique_ptr<TSNextHopSelectionStrategy> strategy;
- for (auto &file_strategie : file_strategies) {
- TSDebug(PLUGIN_NAME, "'%s' '%s' TSRemapNewInstance strategy file had
strategy named '%s'", remap_from, remap_to,
- file_strategie.first.c_str());
- if (strncmp(strategy_name, file_strategie.first.c_str(),
strlen(strategy_name)) != 0) {
+ for (auto &[name, strategy] : file_strategies) {
+ TSDebug(PLUGIN_NAME, "'%s' '%s' TSRemapNewInstance strategy file had
strategy named '%s'", remap_from, remap_to, name.c_str());
+ if (strncmp(strategy_name, name.c_str(), strlen(strategy_name)) != 0) {
continue;
}
- TSDebug(PLUGIN_NAME, "'%s' '%s' TSRemapNewInstance using '%s'",
remap_from, remap_to, file_strategie.first.c_str());
- strategy = std::move(file_strategie.second);
+ TSDebug(PLUGIN_NAME, "'%s' '%s' TSRemapNewInstance using '%s'",
remap_from, remap_to, name.c_str());
+ strategy = std::move(strategy);
Review comment:
Oh. I didn't notice until the diff was displayed like this that
`strategy` would have two variables in this scope with the same name. Perhaps
rename the loop's `strategy` to `map_strategy` or some such?
--
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]