Add some const& to uses of auto.
authorCarl Hetherington <cth@carlh.net>
Sat, 28 Oct 2023 21:04:26 +0000 (23:04 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 28 Oct 2023 21:04:39 +0000 (23:04 +0200)
src/lib/dcp_examiner.cc
src/lib/ffmpeg_file_encoder.cc
src/lib/film.cc
src/wx/video_panel.cc

index a9a6dee5eb20920b9071a6ee78959afa7bfadf9d..0f9ae9544812f414bbd7053369c999214a2de5df 100644 (file)
@@ -83,7 +83,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
 
                for (auto cpl: cpls) {
                        int unsatisfied = 0;
-                       for (auto reel: cpl->reels()) {
+                       for (auto const& reel: cpl->reels()) {
                                if (reel->main_picture() && !reel->main_picture()->asset_ref().resolved()) {
                                        ++unsatisfied;
                                }
index f96a9458ec132c92993a138d39bf8e38094a0b33..7d89b7bd00ce4e7a7fc2027a2bff4bdba2f20ac1 100644 (file)
@@ -388,7 +388,7 @@ FFmpegFileEncoder::flush ()
                }
 
                flushed_audio = true;
-               for (auto i: _audio_streams) {
+               for (auto const& i: _audio_streams) {
                        if (!i->flush()) {
                                flushed_audio = false;
                        }
index 2780dbf5c6a838f4de159ee29988079478825b9d..b4ad0d0f47f93ed319ed39c087a1bb703b826b9c 100644 (file)
@@ -775,7 +775,7 @@ Film::subtitle_languages () const
 {
        pair<optional<dcp::LanguageTag>, vector<dcp::LanguageTag>> result;
        for (auto i: content()) {
-               for (auto text: i->text) {
+               for (auto const& text: i->text) {
                        if (text->use() && text->type() == TextType::OPEN_SUBTITLE && text->language()) {
                                if (text->language_is_additional()) {
                                        result.second.push_back(text->language().get());
index a9ef6e02dea1d36f051d774d94ae988dac86f966..8a02dff25b01acc08e958f05717124dce8f96ad0 100644 (file)
@@ -766,7 +766,7 @@ VideoPanel::left_crop_changed ()
 {
        _left_changed_last = true;
        if (_left_right_link->GetValue()) {
-               for (auto i: _parent->selected_video()) {
+               for (auto const& i: _parent->selected_video()) {
                        i->video->set_right_crop (i->video->requested_left_crop());
                }
        }
@@ -778,7 +778,7 @@ VideoPanel::right_crop_changed ()
 {
        _left_changed_last = false;
        if (_left_right_link->GetValue()) {
-               for (auto i: _parent->selected_video()) {
+               for (auto const& i: _parent->selected_video()) {
                        i->video->set_left_crop (i->video->requested_right_crop());
                }
        }