Cland tidy fixes for channelz

pull/16049/head
ncteisen 7 years ago
parent a9f3d78c6e
commit bc3723bc04
  1. 4
      src/core/ext/filters/client_channel/client_channel_channelz.cc
  2. 4
      src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc
  3. 4
      src/core/ext/filters/client_channel/subchannel.cc

@ -69,7 +69,7 @@ void ClientChannelNode::PopulateChildRefs(grpc_json* json) {
grpc_json* json_iterator = nullptr; grpc_json* json_iterator = nullptr;
grpc_client_channel_populate_child_refs(client_channel_, &child_subchannels, grpc_client_channel_populate_child_refs(client_channel_, &child_subchannels,
&child_channels); &child_channels);
if (child_subchannels.size() > 0) { if (!child_subchannels.empty()) {
grpc_json* array_parent = grpc_json_create_child( grpc_json* array_parent = grpc_json_create_child(
nullptr, json, "subchannelRef", nullptr, GRPC_JSON_ARRAY, false); nullptr, json, "subchannelRef", nullptr, GRPC_JSON_ARRAY, false);
for (size_t i = 0; i < child_subchannels.size(); ++i) { for (size_t i = 0; i < child_subchannels.size(); ++i) {
@ -80,7 +80,7 @@ void ClientChannelNode::PopulateChildRefs(grpc_json* json) {
child_subchannels[i]); child_subchannels[i]);
} }
} }
if (child_channels.size() > 0) { if (!child_channels.empty()) {
grpc_json* array_parent = grpc_json_create_child( grpc_json* array_parent = grpc_json_create_child(
nullptr, json, "channelRef", nullptr, GRPC_JSON_ARRAY, false); nullptr, json, "channelRef", nullptr, GRPC_JSON_ARRAY, false);
json_iterator = nullptr; json_iterator = nullptr;

@ -59,7 +59,7 @@ class PickFirst : public LoadBalancingPolicy {
void PingOneLocked(grpc_closure* on_initiate, grpc_closure* on_ack) override; void PingOneLocked(grpc_closure* on_initiate, grpc_closure* on_ack) override;
void ExitIdleLocked() override; void ExitIdleLocked() override;
void FillChildRefsForChannelz(ChildRefsList* child_subchannels, void FillChildRefsForChannelz(ChildRefsList* child_subchannels,
ChildRefsList* child_channels) override; ChildRefsList* ignored) override;
private: private:
~PickFirst(); ~PickFirst();
@ -181,7 +181,7 @@ void PickFirst::HandOffPendingPicksLocked(LoadBalancingPolicy* new_policy) {
} }
void PickFirst::ShutdownLocked() { void PickFirst::ShutdownLocked() {
AutoChildRefsUpdater(this); AutoChildRefsUpdater gaurd(this);
grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel shutdown"); grpc_error* error = GRPC_ERROR_CREATE_FROM_STATIC_STRING("Channel shutdown");
if (grpc_lb_pick_first_trace.enabled()) { if (grpc_lb_pick_first_trace.enabled()) {
gpr_log(GPR_INFO, "Pick First %p Shutting down", this); gpr_log(GPR_INFO, "Pick First %p Shutting down", this);

@ -390,8 +390,8 @@ grpc_subchannel* grpc_subchannel_create(grpc_connector* connector,
} }
grpc_core::channelz::SubchannelNode* grpc_subchannel_get_channelz_node( grpc_core::channelz::SubchannelNode* grpc_subchannel_get_channelz_node(
grpc_subchannel* s) { grpc_subchannel* subchannel) {
return s->channelz_subchannel.get(); return subchannel->channelz_subchannel.get();
} }
static void continue_connect_locked(grpc_subchannel* c) { static void continue_connect_locked(grpc_subchannel* c) {

Loading…
Cancel
Save