projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbf4e08
)
Simplify the implementation of DCP::add.
author
Carl Hetherington
<cth@carlh.net>
Mon, 3 Jan 2022 23:27:45 +0000
(23:27 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Wed, 20 Apr 2022 18:06:50 +0000
(20:06 +0200)
src/dcp.cc
patch
|
blob
|
history
diff --git
a/src/dcp.cc
b/src/dcp.cc
index 3316b60e98727b233161627a41fa4eeb7413ab8f..05c93b54672f354f7eafafc8d85b111cd7c5438c 100644
(file)
--- a/
src/dcp.cc
+++ b/
src/dcp.cc
@@
-363,13
+363,10
@@
DCP::all_encrypted () const
void
DCP::add (DecryptedKDM const & kdm)
{
- auto keys = kdm.keys ();
-
- for (auto i: cpls()) {
- for (auto const& j: kdm.keys()) {
- if (j.cpl_id() == i->id()) {
- i->add (kdm);
- }
+ auto keys = kdm.keys();
+ for (auto cpl: cpls()) {
+ if (std::any_of(keys.begin(), keys.end(), [cpl](DecryptedKDMKey const& key) { return key.cpl_id() == cpl->id(); })) {
+ cpl->add (kdm);
}
}
}