diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-01-11 00:32:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-01-13 00:30:00 +0100 |
| commit | 501096cb9a14e1722ee3d84ecdbd41f79df6467a (patch) | |
| tree | 541ad53f7ca96db941b0c02b5e307e446b3dafaa /src | |
| parent | 152a1e6976b8188116cd1b819531e135c4c1663f (diff) | |
Rename n -> ffmpeg_count and use count_if().
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/content_menu.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 63a4be19f..d042abf90 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -146,14 +146,13 @@ ContentMenu::popup(weak_ptr<Film> film, ContentList c, TimelineContentViewList v _repeat->Enable(!_content.empty()); - int n = 0; - for (auto i: _content) { - if (dynamic_pointer_cast<FFmpegContent>(i)) { - ++n; - } - } + auto ffmpeg_count = std::count_if( + _content.begin(), + _content.end(), + [](shared_ptr<Content> content) { return static_cast<bool>(dynamic_pointer_cast<FFmpegContent>(content)); } + ); - _join->Enable(n > 1); + _join->Enable(ffmpeg_count > 1); _find_missing->Enable(_content.size() == 1 && (!paths_exist(_content.front()->paths()) || !paths_exist(_content.front()->font_paths()))); _properties->Enable(_content.size() == 1); |
