From 41eced6cc768422be8e2a981180b7af687b350a8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 17 Feb 2019 16:23:11 +0000 Subject: Enable performance checks and fix accordingly --- Jamroot.jam | 1 + libdbpp/mockDatabase.cpp | 2 +- libdbpp/unittests/testUtils.cpp | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Jamroot.jam b/Jamroot.jam index 7e91686..b4bcd7d 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -21,6 +21,7 @@ project tidy:misc-* tidy:modernize-* tidy:hicpp-* + tidy:performance-* ; build-project libdbpp ; diff --git a/libdbpp/mockDatabase.cpp b/libdbpp/mockDatabase.cpp index 7f06b6c..f9c395b 100644 --- a/libdbpp/mockDatabase.cpp +++ b/libdbpp/mockDatabase.cpp @@ -27,7 +27,7 @@ MockDatabase::PlaySchemaScripts(const std::vector & ss) c { auto conn = ConnectionPtr(openConnection()); try { - for (auto s : ss) { + for (const auto & s : ss) { conn->beginTx(); PlaySchemaScript(conn.get(), s); conn->commitTx(); diff --git a/libdbpp/unittests/testUtils.cpp b/libdbpp/unittests/testUtils.cpp index 416d359..483f58b 100644 --- a/libdbpp/unittests/testUtils.cpp +++ b/libdbpp/unittests/testUtils.cpp @@ -352,6 +352,7 @@ BOOST_AUTO_TEST_CASE( testBlobCompare ) std::vector buf1(20, {4, 8}); DB::Blob vec1(buf1); + // NOLINTNEXTLINE(performance-unnecessary-copy-initialization) std::vector buf2(buf1); DB::Blob vec2(buf2); @@ -373,7 +374,7 @@ testExtractT(DB::Row row) { template void -testExtractT(DB::SelectCommandPtr sel) { +testExtractT(const DB::SelectCommandPtr & sel) { // test default construct T test; (void)test; -- cgit v1.2.3