summaryrefslogtreecommitdiff
path: root/src/wx/content_menu.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-01-11 00:32:30 +0100
committerCarl Hetherington <cth@carlh.net>2026-01-13 00:30:00 +0100
commit501096cb9a14e1722ee3d84ecdbd41f79df6467a (patch)
tree541ad53f7ca96db941b0c02b5e307e446b3dafaa /src/wx/content_menu.cc
parent152a1e6976b8188116cd1b819531e135c4c1663f (diff)
Rename n -> ffmpeg_count and use count_if().
Diffstat (limited to 'src/wx/content_menu.cc')
-rw-r--r--src/wx/content_menu.cc13
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);