aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_encryption.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-04-30 19:23:18 +0200
committerJay Berkenbilt <ejb@ql.org>2022-04-30 19:27:18 +0200
commit4f24617e1ea4ba7a6627a9c44304c6e0a0114249 (patch)
tree65c02e9e31cac60bac6f6aec165e8397dcde70e2 /libqpdf/QPDF_encryption.cc
parent7f023701dd843749cf878baabeb3d33917fda62f (diff)
downloadqpdf-4f24617e1ea4ba7a6627a9c44304c6e0a0114249.tar.zst
Code clean up: use range-style for loops wherever possible
Where not possible, use "auto" to get the iterator type. Editorial note: I have avoid this change for a long time because of not wanting to make gratuitous changes to version history, which can obscure when certain changes were made, but with having recently touched every single file to apply automatic code formatting and with making several broad changes to the API, I decided it was time to take the plunge and get rid of the older (pre-C++11) verbose iterator syntax. The new code is just easier to read and understand, and in many cases, it will be more effecient as fewer temporary copies are being made. m-holger, if you're reading, you can see that I've finally come around. :-)
Diffstat (limited to 'libqpdf/QPDF_encryption.cc')
-rw-r--r--libqpdf/QPDF_encryption.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/libqpdf/QPDF_encryption.cc b/libqpdf/QPDF_encryption.cc
index 00920082..b943777f 100644
--- a/libqpdf/QPDF_encryption.cc
+++ b/libqpdf/QPDF_encryption.cc
@@ -945,11 +945,7 @@ QPDF::initializeEncryption()
if ((V == 4) || (V == 5)) {
QPDFObjectHandle CF = encryption_dict.getKey("/CF");
- std::set<std::string> keys = CF.getKeys();
- for (std::set<std::string>::iterator iter = keys.begin();
- iter != keys.end();
- ++iter) {
- std::string const& filter = *iter;
+ for (auto const& filter: CF.getKeys()) {
QPDFObjectHandle cdict = CF.getKey(filter);
if (cdict.isDictionary()) {
encryption_method_e method = e_none;