traeak commented on code in PR #12593:
URL: https://github.com/apache/trafficserver/pull/12593#discussion_r4445146535
##########
src/proxy/http/remap/NextHopStrategyFactory.cc:
##########
@@ -114,6 +114,14 @@ NextHopStrategyFactory::NextHopStrategyFactory(const char
*file) : fn(file)
}
done:
+ if (strategies_loaded) {
+ // Precomputed so that strategyInstance() stays read-only.
+ uint32_t idx = 0;
+ for (auto &[name, strat] : _strategies) {
+ strat->distance = idx++;
+ _strategy_ptrs.insert(strat);
+ }
+ }
Review Comment:
Only uniqueness within a factory is needed, which matches the old behavior.
--
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]