diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-24 00:23:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-24 00:23:19 +0100 |
| commit | 4fab90c545f3b563ebed54b191f27482be38759e (patch) | |
| tree | faa0fcd560085fc1daadfcb0ba2bb4a2178f1a97 /src | |
| parent | 2f92210c782eb1cc80b2326a608417564fa1ed36 (diff) | |
Compress some if statements.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/content_timeline.cc | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/wx/content_timeline.cc b/src/wx/content_timeline.cc index d78c12fb9..682d1e568 100644 --- a/src/wx/content_timeline.cc +++ b/src/wx/content_timeline.cc @@ -408,14 +408,12 @@ place(shared_ptr<const Film> film, ContentTimelineViewList& views, int& tracks) struct AudioMappingComparator { bool operator()(shared_ptr<ContentTimelineView> a, shared_ptr<ContentTimelineView> b) { int la = -1; - auto cva = dynamic_pointer_cast<ContentTimelineAudioView>(a); - if (cva) { + if (auto cva = dynamic_pointer_cast<ContentTimelineAudioView>(a)) { auto oc = cva->content()->audio->mapping().mapped_output_channels(); la = *min_element(boost::begin(oc), boost::end(oc)); } int lb = -1; - auto cvb = dynamic_pointer_cast<ContentTimelineAudioView>(b); - if (cvb) { + if (auto cvb = dynamic_pointer_cast<ContentTimelineAudioView>(b)) { auto oc = cvb->content()->audio->mapping().mapped_output_channels(); lb = *min_element(boost::begin(oc), boost::end(oc)); } @@ -443,8 +441,7 @@ ContentTimeline::assign_tracks() _tracks = 0; for (auto i: _views) { - auto c = dynamic_pointer_cast<TimelineContentView>(i); - if (c) { + if (auto c = dynamic_pointer_cast<TimelineContentView>(i)) { c->unset_track(); } } @@ -887,8 +884,7 @@ void ContentTimeline::clear_selection() { for (auto i: _views) { - shared_ptr<TimelineContentView> cv = dynamic_pointer_cast<TimelineContentView>(i); - if (cv) { + if (auto cv = dynamic_pointer_cast<TimelineContentView>(i)) { cv->set_selected(false); } } @@ -928,8 +924,7 @@ void ContentTimeline::set_selection(ContentList selection) { for (auto i: _views) { - auto cv = dynamic_pointer_cast<TimelineContentView>(i); - if (cv) { + if (auto cv = dynamic_pointer_cast<TimelineContentView>(i)) { cv->set_selected(find(selection.begin(), selection.end(), cv->content()) != selection.end()); } } |
