diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-04-14 16:05:23 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-04-14 16:05:23 +0200 |
| commit | 2c4dcc782d1db5422e9ccefee8ab8fd3639ea064 (patch) | |
| tree | 8ffba558b6ff4b848da823eb1b2115e39f96c907 | |
| parent | c08f6ee68083aed6df557be44f8bb370eb94777c (diff) | |
Cleanup: use a find_if().
| -rw-r--r-- | src/dcp.cc | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -491,14 +491,7 @@ DCP::assets (bool ignore_unresolved) const } auto const id = j->asset_ref().id(); - auto already_got = false; - for (auto k: assets) { - if (k->id() == id) { - already_got = true; - } - } - - if (!already_got) { + if (std::find_if(assets.begin(), assets.end(), [id](shared_ptr<Asset> asset) { return asset->id() == id; }) == assets.end()) { auto o = j->asset_ref().asset(); assets.push_back (o); /* More Interop special-casing */ |
