Optional: Use nullopt and implicit construction in /modules/audio_processing
Changes places where we explicitly construct an Optional to instead use
nullopt or the requisite value type only.
This CL was uploaded by git cl split.
R=henrik.lundin@webrtc.org
Bug: None
Change-Id: I733a83f702fe11884d229a1713cfac952727bde8
Reviewed-on: https://webrtc-review.googlesource.com/23601
Commit-Queue: Oskar Sundbom <ossu@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20786}
diff --git a/modules/audio_processing/aec3/render_signal_analyzer.cc b/modules/audio_processing/aec3/render_signal_analyzer.cc
index 5e29542..22aa352 100644
--- a/modules/audio_processing/aec3/render_signal_analyzer.cc
+++ b/modules/audio_processing/aec3/render_signal_analyzer.cc
@@ -77,11 +77,11 @@
// Detect whether the spectal peak has as strong narrowband nature.
if (peak_bin > 6 && max_abs > 100 &&
X2_latest[peak_bin] > 100 * non_peak_power) {
- *narrow_peak_band = rtc::Optional<int>(peak_bin);
+ *narrow_peak_band = peak_bin;
*narrow_peak_counter = 0;
} else {
if (*narrow_peak_band && ++(*narrow_peak_counter) > 7) {
- *narrow_peak_band = rtc::Optional<int>();
+ *narrow_peak_band = rtc::nullopt;
}
}
}