From 8c5fae07cb1ca0809460b3ac06ae2be8d75ff7e1 Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Fri, 24 Apr 2020 07:10:35 -0400 Subject: Avoid copying in range based for loops This is a new warning in Clang 10 --- src/lib/x509/certstor_flatfile/certstor_flatfile.cpp | 2 +- src/lib/x509/x509path.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/x509') 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 der : decode_all_certificates(file_stream)) + for(const std::vector& der : decode_all_certificates(file_stream)) { std::shared_ptr cert = std::make_shared(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(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}); } -- cgit v1.2.3