Skip to content

Commit

Permalink
Style: Avoid underscores in structured bindings.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 633194751
  • Loading branch information
jwcullen committed May 14, 2024
1 parent b739b18 commit 1dea906
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion iamf/cli/audio_frame_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ absl::Status DumpDecodedAudioFrameToWavWriter(

void AbortAllWavWriters(
absl::node_hash_map<uint32_t, WavWriter>& 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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion iamf/cli/audio_frame_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion iamf/cli/encoder_main_lib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ absl::Status InitAudioFrameDecoderForAllAudioElements(
const absl::flat_hash_map<DecodedUleb128, AudioElementWithData>&
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.
Expand Down
4 changes: 2 additions & 2 deletions iamf/cli/global_timing_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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}});

Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion iamf/common/obu_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ absl::Status ValidateUnique(InputIt first, InputIt last,
absl::flat_hash_set<typename InputIt::value_type> 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));
}
Expand Down

0 comments on commit 1dea906

Please sign in to comment.