Make FieldTrialOptionals operator bool() explicit
Implicit bool conversions behave wierdly in a bunch of cases, so let's make it explicit. Bug: None Change-Id: I15933e90d57c57218eed9608407aace5a640a6ea Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127284 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27076}
This commit is contained in:
@ -183,7 +183,7 @@ class FieldTrialOptional : public FieldTrialParameterInterface {
|
||||
const T& Value() const { return value_.value(); }
|
||||
const T& operator*() const { return value_.value(); }
|
||||
const T* operator->() const { return &value_.value(); }
|
||||
operator bool() const { return value_.has_value(); }
|
||||
explicit operator bool() const { return value_.has_value(); }
|
||||
|
||||
protected:
|
||||
bool Parse(absl::optional<std::string> str_value) override {
|
||||
|
@ -147,7 +147,7 @@ RateControlSettings RateControlSettings::ParseFromKeyValueConfig(
|
||||
}
|
||||
|
||||
bool RateControlSettings::UseCongestionWindow() const {
|
||||
return congestion_window_;
|
||||
return static_cast<bool>(congestion_window_);
|
||||
}
|
||||
|
||||
int64_t RateControlSettings::GetCongestionWindowAdditionalTimeMs() const {
|
||||
|
Reference in New Issue
Block a user