aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/JSON.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-04-09 02:14:04 +0200
committerJay Berkenbilt <ejb@ql.org>2020-04-09 02:45:26 +0200
commit1a7d3700a665a5ae29c8bab67ddc7fee7040b731 (patch)
tree625e79f255f5c57ea438816cb7714628ca0c66a2 /libqpdf/JSON.cc
parentb89b1d772db935ed36b8abe8a21ee6468ada3d23 (diff)
downloadqpdf-1a7d3700a665a5ae29c8bab67ddc7fee7040b731.tar.zst
Fix unnecessary copies in auto iter (fixes #426)
Also switch to colon-style iteration in some cases. Thanks to Dean Scarff for drawing this to my attention after detecting some unnecessary copies with https://clang.llvm.org/extra/clang-tidy/checks/performance-for-range-copy.html
Diffstat (limited to 'libqpdf/JSON.cc')
-rw-r--r--libqpdf/JSON.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc
index 247d3c86..f75935aa 100644
--- a/libqpdf/JSON.cc
+++ b/libqpdf/JSON.cc
@@ -346,7 +346,7 @@ JSON::checkSchemaInternal(JSON_value* this_v, JSON_value* sch_v,
if (sch_dict && (! pattern_key.empty()))
{
auto pattern_schema = sch_dict->members[pattern_key].getPointer();
- for (auto iter: this_dict->members)
+ for (auto const& iter: this_dict->members)
{
std::string const& key = iter.first;
checkSchemaInternal(