diff options
author | Jack Lloyd <[email protected]> | 2020-04-24 07:10:35 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-04-24 09:58:11 -0400 |
commit | 8c5fae07cb1ca0809460b3ac06ae2be8d75ff7e1 (patch) | |
tree | 294be27f2abedc7b80c0ab765d52860936c7ef60 /src/lib/x509 | |
parent | c4ae9cabce82c1f07b8082c67b56203472b7b354 (diff) |
Avoid copying in range based for loops
This is a new warning in Clang 10
Diffstat (limited to 'src/lib/x509')
-rw-r--r-- | src/lib/x509/certstor_flatfile/certstor_flatfile.cpp | 2 | ||||
-rw-r--r-- | src/lib/x509/x509path.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/x509/certstor_flatfile/certstor_flatfile.cpp b/src/lib/x509/certstor_flatfile/certstor_flatfile.cpp index 90feecd24..078bf22a9 100644 --- a/src/lib/x509/certstor_flatfile/certstor_flatfile.cpp +++ b/src/lib/x509/certstor_flatfile/certstor_flatfile.cpp @@ -47,7 +47,7 @@ Flatfile_Certificate_Store::Flatfile_Certificate_Store(const std::string& file, DataSource_Stream file_stream(file); - for(const std::vector<uint8_t> der : decode_all_certificates(file_stream)) + for(const std::vector<uint8_t>& der : decode_all_certificates(file_stream)) { std::shared_ptr<const X509_Certificate> cert = std::make_shared<const X509_Certificate>(der.data(), der.size()); diff --git a/src/lib/x509/x509path.cpp b/src/lib/x509/x509path.cpp index 03daee146..a2cfbbb1c 100644 --- a/src/lib/x509/x509path.cpp +++ b/src/lib/x509/x509path.cpp @@ -731,12 +731,12 @@ PKIX::build_all_certificate_paths(std::vector<std::vector<std::shared_ptr<const // push a deletion marker on the stack for backtracing later stack.push_back({std::shared_ptr<const X509_Certificate>(nullptr),false}); - for(const auto trusted_cert : trusted_issuers) + for(const auto& trusted_cert : trusted_issuers) { stack.push_back({trusted_cert,true}); } - for(const auto misc : misc_issuers) + for(const auto& misc : misc_issuers) { stack.push_back({misc,false}); } |