stdc++: remove unneeded absl::optional wrapping
std::optional<T>::emplace() without an initializer is broken on clang++
with gnu libstdc++. this workarounds the bug by removing the
absl::optional wrapping, which is actually pointless.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101227
Bug: chromium:41455655
Change-Id: I05354e57cc4cdda3fa6d3cd23f46462b69cc3bee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/355900
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Diep Bui <diepbp@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42561}
diff --git a/AUTHORS b/AUTHORS
index 153b245..7b16d7c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -71,6 +71,7 @@
Kiran Thind <kiran.thind@gmail.com>
Korniltsev Anatoly <korniltsev.anatoly@gmail.com>
Kyutae Lee <gorisanson@gmail.com>
+lauren n. liberda <lauren@selfisekai.rocks>
Lennart Grahl <lennart.grahl@gmail.com>
Luke Weber <luke.weber@gmail.com>
Maksim Khobat <maksimkhobat@gmail.com>
diff --git a/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc b/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc
index 7deeb7a..2e0e4a0 100644
--- a/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc
+++ b/modules/congestion_controller/goog_cc/loss_based_bwe_v2.cc
@@ -545,69 +545,68 @@
key_value_config->Lookup("WebRTC-Bwe-LossBasedBweV2"));
}
- absl::optional<Config> config;
if (!enabled.Get()) {
- return config;
+ return absl::nullopt;
}
- config.emplace();
- config->bandwidth_rampup_upper_bound_factor =
+ Config config;
+ config.bandwidth_rampup_upper_bound_factor =
bandwidth_rampup_upper_bound_factor.Get();
- config->bandwidth_rampup_upper_bound_factor_in_hold =
+ config.bandwidth_rampup_upper_bound_factor_in_hold =
bandwidth_rampup_upper_bound_factor_in_hold.Get();
- config->bandwidth_rampup_hold_threshold =
+ config.bandwidth_rampup_hold_threshold =
bandwidth_rampup_hold_threshold.Get();
- config->rampup_acceleration_max_factor = rampup_acceleration_max_factor.Get();
- config->rampup_acceleration_maxout_time =
+ config.rampup_acceleration_max_factor = rampup_acceleration_max_factor.Get();
+ config.rampup_acceleration_maxout_time =
rampup_acceleration_maxout_time.Get();
- config->candidate_factors = candidate_factors.Get();
- config->higher_bandwidth_bias_factor = higher_bandwidth_bias_factor.Get();
- config->higher_log_bandwidth_bias_factor =
+ config.candidate_factors = candidate_factors.Get();
+ config.higher_bandwidth_bias_factor = higher_bandwidth_bias_factor.Get();
+ config.higher_log_bandwidth_bias_factor =
higher_log_bandwidth_bias_factor.Get();
- config->inherent_loss_lower_bound = inherent_loss_lower_bound.Get();
- config->loss_threshold_of_high_bandwidth_preference =
+ config.inherent_loss_lower_bound = inherent_loss_lower_bound.Get();
+ config.loss_threshold_of_high_bandwidth_preference =
loss_threshold_of_high_bandwidth_preference.Get();
- config->bandwidth_preference_smoothing_factor =
+ config.bandwidth_preference_smoothing_factor =
bandwidth_preference_smoothing_factor.Get();
- config->inherent_loss_upper_bound_bandwidth_balance =
+ config.inherent_loss_upper_bound_bandwidth_balance =
inherent_loss_upper_bound_bandwidth_balance.Get();
- config->inherent_loss_upper_bound_offset =
+ config.inherent_loss_upper_bound_offset =
inherent_loss_upper_bound_offset.Get();
- config->initial_inherent_loss_estimate = initial_inherent_loss_estimate.Get();
- config->newton_iterations = newton_iterations.Get();
- config->newton_step_size = newton_step_size.Get();
- config->append_acknowledged_rate_candidate =
+ config.initial_inherent_loss_estimate = initial_inherent_loss_estimate.Get();
+ config.newton_iterations = newton_iterations.Get();
+ config.newton_step_size = newton_step_size.Get();
+ config.append_acknowledged_rate_candidate =
append_acknowledged_rate_candidate.Get();
- config->append_delay_based_estimate_candidate =
+ config.append_delay_based_estimate_candidate =
append_delay_based_estimate_candidate.Get();
- config->append_upper_bound_candidate_in_alr =
+ config.append_upper_bound_candidate_in_alr =
append_upper_bound_candidate_in_alr.Get();
- config->observation_duration_lower_bound =
+ config.observation_duration_lower_bound =
observation_duration_lower_bound.Get();
- config->observation_window_size = observation_window_size.Get();
- config->sending_rate_smoothing_factor = sending_rate_smoothing_factor.Get();
- config->instant_upper_bound_temporal_weight_factor =
+ config.observation_window_size = observation_window_size.Get();
+ config.sending_rate_smoothing_factor = sending_rate_smoothing_factor.Get();
+ config.instant_upper_bound_temporal_weight_factor =
instant_upper_bound_temporal_weight_factor.Get();
- config->instant_upper_bound_bandwidth_balance =
+ config.instant_upper_bound_bandwidth_balance =
instant_upper_bound_bandwidth_balance.Get();
- config->instant_upper_bound_loss_offset =
+ config.instant_upper_bound_loss_offset =
instant_upper_bound_loss_offset.Get();
- config->temporal_weight_factor = temporal_weight_factor.Get();
- config->bandwidth_backoff_lower_bound_factor =
+ config.temporal_weight_factor = temporal_weight_factor.Get();
+ config.bandwidth_backoff_lower_bound_factor =
bandwidth_backoff_lower_bound_factor.Get();
- config->max_increase_factor = max_increase_factor.Get();
- config->delayed_increase_window = delayed_increase_window.Get();
- config->not_increase_if_inherent_loss_less_than_average_loss =
+ config.max_increase_factor = max_increase_factor.Get();
+ config.delayed_increase_window = delayed_increase_window.Get();
+ config.not_increase_if_inherent_loss_less_than_average_loss =
not_increase_if_inherent_loss_less_than_average_loss.Get();
- config->not_use_acked_rate_in_alr = not_use_acked_rate_in_alr.Get();
- config->use_in_start_phase = use_in_start_phase.Get();
- config->min_num_observations = min_num_observations.Get();
- config->lower_bound_by_acked_rate_factor =
+ config.not_use_acked_rate_in_alr = not_use_acked_rate_in_alr.Get();
+ config.use_in_start_phase = use_in_start_phase.Get();
+ config.min_num_observations = min_num_observations.Get();
+ config.lower_bound_by_acked_rate_factor =
lower_bound_by_acked_rate_factor.Get();
- config->hold_duration_factor = hold_duration_factor.Get();
- config->use_byte_loss_rate = use_byte_loss_rate.Get();
- config->padding_duration = padding_duration.Get();
- config->bound_best_candidate = bound_best_candidate.Get();
- config->pace_at_loss_based_estimate = pace_at_loss_based_estimate.Get();
+ config.hold_duration_factor = hold_duration_factor.Get();
+ config.use_byte_loss_rate = use_byte_loss_rate.Get();
+ config.padding_duration = padding_duration.Get();
+ config.bound_best_candidate = bound_best_candidate.Get();
+ config.pace_at_loss_based_estimate = pace_at_loss_based_estimate.Get();
return config;
}