From 7e3aae3cb9cb5e61ecf6a297b8fd8544a76f36c4 Mon Sep 17 00:00:00 2001 From: reuk Date: Tue, 5 Aug 2025 12:36:03 +0100 Subject: [PATCH] AU: Refactor getAUChannelInfo to make mismatch checking more concise --- .../format_types/juce_AU_Shared.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/modules/juce_audio_processors/format_types/juce_AU_Shared.h b/modules/juce_audio_processors/format_types/juce_AU_Shared.h index 3cf11e3afe..669796f633 100644 --- a/modules/juce_audio_processors/format_types/juce_AU_Shared.h +++ b/modules/juce_audio_processors/format_types/juce_AU_Shared.h @@ -429,16 +429,9 @@ struct AudioUnitHelpers } } - auto hasInOutMismatch = false; - - for (const auto& supported : supportedChannels) - { - if (supported.ins != supported.outs) - { - hasInOutMismatch = true; - break; - } - } + const auto hasInOutMismatch = std::any_of (supportedChannels.begin(), + supportedChannels.end(), + [] (const Channels& x) { return x.ins != x.outs; }); const auto computeHasUnsupportedLayout = [&] (bool isInput) {