Skip to content

Commit

Permalink
clang-tidy: fixes error in common::Cleanup class (#37377)
Browse files Browse the repository at this point in the history
part of #28566

Signed-off-by: Takeshi Yoneda <[email protected]>
  • Loading branch information
mathetake authored Nov 27, 2024
1 parent 1f0e89b commit d9e1d22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion envoy/common/execution_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
}()
Expand Down
4 changes: 2 additions & 2 deletions source/common/common/cleanup.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class Cleanup {

bool cancelled() { return cancelled_; }

static Cleanup Noop() {
return Cleanup([] {});
static Cleanup noop() {
return {[]() {}};
}

private:
Expand Down
4 changes: 2 additions & 2 deletions test/common/common/execution_context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d9e1d22

Please sign in to comment.