Don't add API to Optional

reviewable/pr18746/r4
Yash Tibrewal 6 years ago
parent a045170818
commit 51fd073b7c
  1. 4
      src/core/ext/filters/client_channel/lb_policy/xds/xds.cc
  2. 4
      src/core/ext/filters/client_channel/resolver_result_parsing.cc
  3. 5
      src/core/lib/gprpp/optional.h

@ -1530,8 +1530,8 @@ void XdsLb::UpdateLocked(UpdateArgs args) {
return; return;
} }
ProcessAddressesAndChannelArgsLocked(args.addresses, *args.args); ProcessAddressesAndChannelArgsLocked(args.addresses, *args.args);
locality_map_.UpdateLocked(locality_serverlist_, child_policy_config_, locality_map_.UpdateLocked(locality_serverlist_, child_policy_config_, args_,
args_, this); this);
// Update the existing fallback policy. The fallback policy config and/or the // Update the existing fallback policy. The fallback policy config and/or the
// fallback addresses may be new. // fallback addresses may be new.
if (fallback_policy_ != nullptr) UpdateFallbackPolicyLocked(); if (fallback_policy_ != nullptr) UpdateFallbackPolicyLocked();

@ -401,8 +401,8 @@ ClientChannelServiceConfigParser::ParseGlobalParams(const grpc_json* json,
error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING( error_list.push_back(GRPC_ERROR_CREATE_FROM_STATIC_STRING(
"field:retryThrottling error:Duplicate entry")); "field:retryThrottling error:Duplicate entry"));
} else { } else {
Optional<int> max_milli_tokens(false, 0); Optional<int> max_milli_tokens;
Optional<int> milli_token_ratio(false, 0); Optional<int> milli_token_ratio;
for (grpc_json* sub_field = field->child; sub_field != nullptr; for (grpc_json* sub_field = field->child; sub_field != nullptr;
sub_field = sub_field->next) { sub_field = sub_field->next) {
if (sub_field->key == nullptr) continue; if (sub_field->key == nullptr) continue;

@ -26,9 +26,6 @@ namespace grpc_core {
template <typename T> template <typename T>
class Optional { class Optional {
public: public:
Optional() = default;
Optional(bool set, T value) : set_(set), value_(value) {}
void set(const T& val) { void set(const T& val) {
value_ = val; value_ = val;
set_ = true; set_ = true;
@ -42,7 +39,7 @@ class Optional {
private: private:
bool set_ = false; bool set_ = false;
T value_; T value_ = {};
}; };
} /* namespace grpc_core */ } /* namespace grpc_core */

Loading…
Cancel
Save