Replace a slightly tortured lambda with a loop.
authorCarl Hetherington <cth@carlh.net>
Mon, 16 Oct 2023 18:19:53 +0000 (20:19 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 16 Oct 2023 18:19:53 +0000 (20:19 +0200)
src/lib/reel_writer.cc

index 9383f7c838a551ca8545e602776b4c985da1b7f3..78e504697cf9d37ca492a68099ddeb64f9ae9fa6 100644 (file)
@@ -194,16 +194,11 @@ ReelWriter::ReelWriter (
                DCPOMATIC_ASSERT (film()->directory());
 
                std::vector<dcp::Channel> extra_active_channels;
-               auto add_if_mapped = [this, &extra_active_channels](dcp::Channel channel) {
+               for (auto channel: std::vector<dcp::Channel>{dcp::Channel::HI, dcp::Channel::VI, dcp::Channel::BSL, dcp::Channel::BSR}) {
                        if (channel_is_mapped(film(), channel)) {
                                extra_active_channels.push_back(channel);
                        }
-               };
-
-               add_if_mapped(dcp::Channel::HI);
-               add_if_mapped(dcp::Channel::VI);
-               add_if_mapped(dcp::Channel::BSL);
-               add_if_mapped(dcp::Channel::BSR);
+               }
 
                /* Write the sound asset into the film directory so that we leave the creation
                   of the DCP directory until the last minute.