diff --git a/envoy/common/execution_context.h b/envoy/common/execution_context.h index dada24e31697..fbe312bdc03e 100644 --- a/envoy/common/execution_context.h +++ b/envoy/common/execution_context.h @@ -115,7 +115,7 @@ class ScopedExecutionContext : NonCopyable { [execution_context = ExecutionContext::fromStreamInfo(trackedStream), \ scoped_object = (scopedObject)] { \ if (execution_context == nullptr) { \ - return Envoy::Cleanup::Noop(); \ + return Envoy::Cleanup::noop(); \ } \ return execution_context->onScopeEnter(scoped_object); \ }() diff --git a/source/common/common/cleanup.h b/source/common/common/cleanup.h index bdefb1cbb29f..103465abf82c 100644 --- a/source/common/common/cleanup.h +++ b/source/common/common/cleanup.h @@ -24,8 +24,8 @@ class Cleanup { bool cancelled() { return cancelled_; } - static Cleanup Noop() { - return Cleanup([] {}); + static Cleanup noop() { + return {[]() {}}; } private: diff --git a/test/common/common/execution_context_test.cc b/test/common/common/execution_context_test.cc index 66dd126ce4aa..c2a6757631f6 100644 --- a/test/common/common/execution_context_test.cc +++ b/test/common/common/execution_context_test.cc @@ -22,11 +22,11 @@ thread_local const Http::FilterContext* current_filter_context = nullptr; class TestExecutionContext : public ExecutionContext { public: - Envoy::Cleanup onScopeEnter(Envoy::Tracing::Span*) override { return Envoy::Cleanup::Noop(); } + Envoy::Cleanup onScopeEnter(Envoy::Tracing::Span*) override { return Envoy::Cleanup::noop(); } Envoy::Cleanup onScopeEnter(const Http::FilterContext* filter_context) override { if (filter_context == nullptr) { - return Envoy::Cleanup::Noop(); + return Envoy::Cleanup::noop(); } const Http::FilterContext* old_filter_context = current_filter_context; current_filter_context = filter_context;