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}
This commit is contained in:
lauren n. liberda 2024-06-28 14:55:39 +02:00 committed by WebRTC LUCI CQ
parent f5ccb396b1
commit 4157f3def0
2 changed files with 42 additions and 42 deletions

View File

@ -71,6 +71,7 @@ Keiichi Enomoto <enm10k@gmail.com>
Kiran Thind <kiran.thind@gmail.com> Kiran Thind <kiran.thind@gmail.com>
Korniltsev Anatoly <korniltsev.anatoly@gmail.com> Korniltsev Anatoly <korniltsev.anatoly@gmail.com>
Kyutae Lee <gorisanson@gmail.com> Kyutae Lee <gorisanson@gmail.com>
lauren n. liberda <lauren@selfisekai.rocks>
Lennart Grahl <lennart.grahl@gmail.com> Lennart Grahl <lennart.grahl@gmail.com>
Luke Weber <luke.weber@gmail.com> Luke Weber <luke.weber@gmail.com>
Maksim Khobat <maksimkhobat@gmail.com> Maksim Khobat <maksimkhobat@gmail.com>

View File

@ -545,69 +545,68 @@ absl::optional<LossBasedBweV2::Config> LossBasedBweV2::CreateConfig(
key_value_config->Lookup("WebRTC-Bwe-LossBasedBweV2")); key_value_config->Lookup("WebRTC-Bwe-LossBasedBweV2"));
} }
absl::optional<Config> config;
if (!enabled.Get()) { if (!enabled.Get()) {
return config; return absl::nullopt;
} }
config.emplace(); Config config;
config->bandwidth_rampup_upper_bound_factor = config.bandwidth_rampup_upper_bound_factor =
bandwidth_rampup_upper_bound_factor.Get(); 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(); bandwidth_rampup_upper_bound_factor_in_hold.Get();
config->bandwidth_rampup_hold_threshold = config.bandwidth_rampup_hold_threshold =
bandwidth_rampup_hold_threshold.Get(); bandwidth_rampup_hold_threshold.Get();
config->rampup_acceleration_max_factor = rampup_acceleration_max_factor.Get(); config.rampup_acceleration_max_factor = rampup_acceleration_max_factor.Get();
config->rampup_acceleration_maxout_time = config.rampup_acceleration_maxout_time =
rampup_acceleration_maxout_time.Get(); rampup_acceleration_maxout_time.Get();
config->candidate_factors = candidate_factors.Get(); config.candidate_factors = candidate_factors.Get();
config->higher_bandwidth_bias_factor = higher_bandwidth_bias_factor.Get(); config.higher_bandwidth_bias_factor = higher_bandwidth_bias_factor.Get();
config->higher_log_bandwidth_bias_factor = config.higher_log_bandwidth_bias_factor =
higher_log_bandwidth_bias_factor.Get(); higher_log_bandwidth_bias_factor.Get();
config->inherent_loss_lower_bound = inherent_loss_lower_bound.Get(); config.inherent_loss_lower_bound = inherent_loss_lower_bound.Get();
config->loss_threshold_of_high_bandwidth_preference = config.loss_threshold_of_high_bandwidth_preference =
loss_threshold_of_high_bandwidth_preference.Get(); loss_threshold_of_high_bandwidth_preference.Get();
config->bandwidth_preference_smoothing_factor = config.bandwidth_preference_smoothing_factor =
bandwidth_preference_smoothing_factor.Get(); 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(); 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(); inherent_loss_upper_bound_offset.Get();
config->initial_inherent_loss_estimate = initial_inherent_loss_estimate.Get(); config.initial_inherent_loss_estimate = initial_inherent_loss_estimate.Get();
config->newton_iterations = newton_iterations.Get(); config.newton_iterations = newton_iterations.Get();
config->newton_step_size = newton_step_size.Get(); config.newton_step_size = newton_step_size.Get();
config->append_acknowledged_rate_candidate = config.append_acknowledged_rate_candidate =
append_acknowledged_rate_candidate.Get(); append_acknowledged_rate_candidate.Get();
config->append_delay_based_estimate_candidate = config.append_delay_based_estimate_candidate =
append_delay_based_estimate_candidate.Get(); 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(); append_upper_bound_candidate_in_alr.Get();
config->observation_duration_lower_bound = config.observation_duration_lower_bound =
observation_duration_lower_bound.Get(); observation_duration_lower_bound.Get();
config->observation_window_size = observation_window_size.Get(); config.observation_window_size = observation_window_size.Get();
config->sending_rate_smoothing_factor = sending_rate_smoothing_factor.Get(); config.sending_rate_smoothing_factor = sending_rate_smoothing_factor.Get();
config->instant_upper_bound_temporal_weight_factor = config.instant_upper_bound_temporal_weight_factor =
instant_upper_bound_temporal_weight_factor.Get(); 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(); instant_upper_bound_bandwidth_balance.Get();
config->instant_upper_bound_loss_offset = config.instant_upper_bound_loss_offset =
instant_upper_bound_loss_offset.Get(); instant_upper_bound_loss_offset.Get();
config->temporal_weight_factor = temporal_weight_factor.Get(); config.temporal_weight_factor = temporal_weight_factor.Get();
config->bandwidth_backoff_lower_bound_factor = config.bandwidth_backoff_lower_bound_factor =
bandwidth_backoff_lower_bound_factor.Get(); bandwidth_backoff_lower_bound_factor.Get();
config->max_increase_factor = max_increase_factor.Get(); config.max_increase_factor = max_increase_factor.Get();
config->delayed_increase_window = delayed_increase_window.Get(); config.delayed_increase_window = delayed_increase_window.Get();
config->not_increase_if_inherent_loss_less_than_average_loss = config.not_increase_if_inherent_loss_less_than_average_loss =
not_increase_if_inherent_loss_less_than_average_loss.Get(); 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.not_use_acked_rate_in_alr = not_use_acked_rate_in_alr.Get();
config->use_in_start_phase = use_in_start_phase.Get(); config.use_in_start_phase = use_in_start_phase.Get();
config->min_num_observations = min_num_observations.Get(); config.min_num_observations = min_num_observations.Get();
config->lower_bound_by_acked_rate_factor = config.lower_bound_by_acked_rate_factor =
lower_bound_by_acked_rate_factor.Get(); lower_bound_by_acked_rate_factor.Get();
config->hold_duration_factor = hold_duration_factor.Get(); config.hold_duration_factor = hold_duration_factor.Get();
config->use_byte_loss_rate = use_byte_loss_rate.Get(); config.use_byte_loss_rate = use_byte_loss_rate.Get();
config->padding_duration = padding_duration.Get(); config.padding_duration = padding_duration.Get();
config->bound_best_candidate = bound_best_candidate.Get(); config.bound_best_candidate = bound_best_candidate.Get();
config->pace_at_loss_based_estimate = pace_at_loss_based_estimate.Get(); config.pace_at_loss_based_estimate = pace_at_loss_based_estimate.Get();
return config; return config;
} }