From 927467490609e5c227ed32b7b195bb75bc2915d1 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 16 Oct 2019 23:43:38 -0700 Subject: [PATCH] Revert one change back to an iterated loop rather than range-based --- include/grpcpp/impl/codegen/client_interceptor.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/grpcpp/impl/codegen/client_interceptor.h b/include/grpcpp/impl/codegen/client_interceptor.h index f4cddffb599..03cb41fb58f 100644 --- a/include/grpcpp/impl/codegen/client_interceptor.h +++ b/include/grpcpp/impl/codegen/client_interceptor.h @@ -145,8 +145,11 @@ class ClientRpcInfo { // No interceptors to register return; } - for (const auto& creator : creators) { - auto* interceptor = creator->CreateClientInterceptor(this); + // NOTE: The following is not a range-based for loop because it will only + // iterate over a portion of the creators vector. + for (auto it = creators.begin() + interceptor_pos; it != creators.end(); + ++it) { + auto* interceptor = (*it)->CreateClientInterceptor(this); if (interceptor != nullptr) { interceptors_.push_back( std::unique_ptr(interceptor));