You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "maskit (via GitHub)" <gi...@apache.org> on 2023/03/01 17:36:52 UTC
[GitHub] [trafficserver] maskit commented on a diff in pull request #9480: Slight performance improvements before calling APIHooks::clear
maskit commented on code in PR #9480:
URL: https://github.com/apache/trafficserver/pull/9480#discussion_r1122099978
##########
proxy/InkAPIInternal.h:
##########
@@ -207,10 +207,14 @@ template <typename ID, int N>
void
FeatureAPIHooks<ID, N>::clear()
{
- for (auto &h : m_hooks) {
- h.clear();
+ if (m_hooks_p) {
+ for (auto &h : m_hooks) {
+ if (!h.is_empty()) {
Review Comment:
Why don't you check this in `APIHooks::clear()`? I guess `clean()` could just return without doing anything if it's empty.
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org