Cleanup: use a std::find_if().
authorCarl Hetherington <cth@carlh.net>
Tue, 8 Aug 2023 13:17:46 +0000 (15:17 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 8 Aug 2023 22:42:59 +0000 (00:42 +0200)
src/lib/film.cc

index 647675b8aa05832148d8596eef0d4ac6694ff887..171a9aa4df583f1facc9662ad8d333b034682c02 100644 (file)
@@ -1929,13 +1929,10 @@ Film::references_dcp_audio () const
 bool
 Film::contains_atmos_content () const
 {
-       for (auto i: _playlist->content()) {
-               if (i->atmos) {
-                       return true;
-               }
-       }
-
-       return false;
+       auto const content = _playlist->content();
+       return std::find_if(content.begin(), content.end(), [](shared_ptr<const Content> content) {
+               return static_cast<bool>(content->atmos);
+       }) != content.end();
 }