diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-04-30 19:23:18 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-04-30 19:27:18 +0200 |
commit | 4f24617e1ea4ba7a6627a9c44304c6e0a0114249 (patch) | |
tree | 65c02e9e31cac60bac6f6aec165e8397dcde70e2 /examples/pdf-overlay-page.cc | |
parent | 7f023701dd843749cf878baabeb3d33917fda62f (diff) | |
download | qpdf-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 'examples/pdf-overlay-page.cc')
-rw-r--r-- | examples/pdf-overlay-page.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/examples/pdf-overlay-page.cc b/examples/pdf-overlay-page.cc index 64a8d48f..f9603d9c 100644 --- a/examples/pdf-overlay-page.cc +++ b/examples/pdf-overlay-page.cc @@ -42,11 +42,7 @@ stamp_page(char const* infile, char const* stampfile, char const* outfile) // For each page... std::vector<QPDFPageObjectHelper> pages = QPDFPageDocumentHelper(inpdf).getAllPages(); - for (std::vector<QPDFPageObjectHelper>::iterator iter = pages.begin(); - iter != pages.end(); - ++iter) { - QPDFPageObjectHelper& ph = *iter; - + for (auto& ph: pages) { // Find a unique resource name for the new form XObject QPDFObjectHandle resources = ph.getAttribute("/Resources", true); int min_suffix = 1; |