projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1e010ab
)
Cleanup: use find_if().
author
Carl Hetherington
<cth@carlh.net>
Sun, 28 May 2023 00:12:03 +0000
(
02:12
+0200)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 28 May 2023 18:55:25 +0000
(20:55 +0200)
src/interop_subtitle_asset.cc
patch
|
blob
|
history
diff --git
a/src/interop_subtitle_asset.cc
b/src/interop_subtitle_asset.cc
index 8fb115a73ee8a6eef4a6294dc3409f511ff45a57..0116c11c539a1a2d0390a6ac1003a6af9f8427b5 100644
(file)
--- a/
src/interop_subtitle_asset.cc
+++ b/
src/interop_subtitle_asset.cc
@@
-214,13
+214,10
@@
InteropSubtitleAsset::write (boost::filesystem::path p) const
/* Fonts */
for (auto i: _load_font_nodes) {
auto file = p.parent_path() / i->uri;
/* Fonts */
for (auto i: _load_font_nodes) {
auto file = p.parent_path() / i->uri;
- auto j = _fonts.begin();
- while (j != _fonts.end() && j->load_id != i->id) {
- ++j;
- }
- if (j != _fonts.end ()) {
- j->data.write (file);
- j->file = file;
+ auto font_with_id = std::find_if(_fonts.begin(), _fonts.end(), [i](Font const& font) { return font.load_id == i->id; });
+ if (font_with_id != _fonts.end()) {
+ font_with_id->data.write(file);
+ font_with_id->file = file;
}
}
}
}
}
}