From 1dea906e0a3b0ac1b020777b11794e7ac3306867 Mon Sep 17 00:00:00 2001 From: jwcullen Date: Mon, 13 May 2024 09:56:38 -0400 Subject: [PATCH] Style: Avoid underscores in structured bindings. PiperOrigin-RevId: 633194751 --- iamf/cli/audio_frame_decoder.cc | 2 +- iamf/cli/audio_frame_generator.cc | 2 +- iamf/cli/encoder_main_lib.cc | 2 +- iamf/cli/global_timing_module.cc | 4 ++-- iamf/common/obu_util.h | 3 ++- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/iamf/cli/audio_frame_decoder.cc b/iamf/cli/audio_frame_decoder.cc index b224d90c..79c2696e 100644 --- a/iamf/cli/audio_frame_decoder.cc +++ b/iamf/cli/audio_frame_decoder.cc @@ -174,7 +174,7 @@ absl::Status DumpDecodedAudioFrameToWavWriter( void AbortAllWavWriters( absl::node_hash_map& substream_id_to_wav_writers) { - for (auto& [_, wav_writer] : substream_id_to_wav_writers) { + for (auto& [unused_substream_id, wav_writer] : substream_id_to_wav_writers) { wav_writer.Abort(); } } diff --git a/iamf/cli/audio_frame_generator.cc b/iamf/cli/audio_frame_generator.cc index de769fc7..13efccae 100644 --- a/iamf/cli/audio_frame_generator.cc +++ b/iamf/cli/audio_frame_generator.cc @@ -860,7 +860,7 @@ absl::Status AudioFrameGenerator::OutputFrames( absl::Status AudioFrameGenerator::Finalize() { absl::MutexLock lock(&mutex_); - for (auto& [_, encoder] : substream_id_to_encoder_) { + for (auto& [unused_substream_id, encoder] : substream_id_to_encoder_) { // Signal all encoders that there are no more samples to come. RETURN_IF_NOT_OK(encoder->Finalize()); } diff --git a/iamf/cli/encoder_main_lib.cc b/iamf/cli/encoder_main_lib.cc index d96c526e..23e0b213 100644 --- a/iamf/cli/encoder_main_lib.cc +++ b/iamf/cli/encoder_main_lib.cc @@ -160,7 +160,7 @@ absl::Status InitAudioFrameDecoderForAllAudioElements( const absl::flat_hash_map& audio_elements, AudioFrameDecoder& audio_frame_decoder) { - for (const auto& [_, audio_element] : audio_elements) { + for (const auto& [unused_audio_element_id, audio_element] : audio_elements) { if (audio_element.codec_config == nullptr) { // Skip stray audio elements. We won't know how to decode their // substreams. diff --git a/iamf/cli/global_timing_module.cc b/iamf/cli/global_timing_module.cc index cd345555..c48a14f2 100644 --- a/iamf/cli/global_timing_module.cc +++ b/iamf/cli/global_timing_module.cc @@ -68,7 +68,7 @@ absl::Status GlobalTimingModule::Initialize( RETURN_IF_NOT_OK( ValidateNotEqual(sample_rate, uint32_t{0}, "sample rate")); - const auto [_, inserted] = audio_frame_timing_data_.insert( + const auto [unused_iter, inserted] = audio_frame_timing_data_.insert( {audio_substream_id, {.rate = sample_rate, .global_start_timestamp = 0, .timestamp = 0}}); @@ -86,7 +86,7 @@ absl::Status GlobalTimingModule::Initialize( RETURN_IF_NOT_OK( ValidateNotEqual(parameter_rate, DecodedUleb128(0), "parameter rate")); - const auto [_, inserted] = + const auto [unused_iter, inserted] = parameter_block_timing_data_.insert({parameter_id, {.rate = parameter_rate, .global_start_timestamp = 0, diff --git a/iamf/common/obu_util.h b/iamf/common/obu_util.h index 001ec0cb..2d7be2ac 100644 --- a/iamf/common/obu_util.h +++ b/iamf/common/obu_util.h @@ -266,7 +266,8 @@ absl::Status ValidateUnique(InputIt first, InputIt last, absl::flat_hash_set seen_values; for (auto iter = first; iter != last; ++iter) { - if (const auto& [_, inserted] = seen_values.insert(*iter); !inserted) { + if (const auto& [unused_iter, inserted] = seen_values.insert(*iter); + !inserted) { return absl::InvalidArgumentError( absl::StrCat(context, " must be unique. Found duplicate: ", *iter)); }