From f173b0a535e4d97c3ecd913eafb5e5c40aca2d44 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sat, 18 Aug 2018 16:08:25 +0200 Subject: Avoid copy by passing shared_ptr<> with const reference. --- tests/parser/attachmentHelperTest.cpp | 4 ++-- tests/parser/bodyPartTest.cpp | 2 +- tests/parser/htmlTextPartTest.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/parser') diff --git a/tests/parser/attachmentHelperTest.cpp b/tests/parser/attachmentHelperTest.cpp index 4d4a2623..6bd3b7db 100644 --- a/tests/parser/attachmentHelperTest.cpp +++ b/tests/parser/attachmentHelperTest.cpp @@ -39,7 +39,7 @@ VMIME_TEST_SUITE_BEGIN(attachmentHelperTest) VMIME_TEST_LIST_END - static const vmime::string getStructure(vmime::shared_ptr part) + static const vmime::string getStructure(const vmime::shared_ptr & part) { vmime::shared_ptr bdy = part->getBody(); @@ -63,7 +63,7 @@ VMIME_TEST_SUITE_BEGIN(attachmentHelperTest) return res + "]"; } - static const vmime::string extractBodyContents(vmime::shared_ptr part) + static const vmime::string extractBodyContents(const vmime::shared_ptr & part) { vmime::shared_ptr cth = part->getBody()->getContents(); diff --git a/tests/parser/bodyPartTest.cpp b/tests/parser/bodyPartTest.cpp index 4dc5d670..e6ff737a 100644 --- a/tests/parser/bodyPartTest.cpp +++ b/tests/parser/bodyPartTest.cpp @@ -49,7 +49,7 @@ VMIME_TEST_SUITE_BEGIN(bodyPartTest) buffer.begin() + c.getParsedOffset() + c.getParsedLength()); } - static const vmime::string extractContents(const vmime::shared_ptr cts) + static const vmime::string extractContents(const vmime::shared_ptr & cts) { std::ostringstream oss; vmime::utility::outputStreamAdapter os(oss); diff --git a/tests/parser/htmlTextPartTest.cpp b/tests/parser/htmlTextPartTest.cpp index 278a87c1..9eef5e84 100644 --- a/tests/parser/htmlTextPartTest.cpp +++ b/tests/parser/htmlTextPartTest.cpp @@ -35,7 +35,7 @@ VMIME_TEST_SUITE_BEGIN(htmlTextPartTest) static const vmime::string extractContent - (vmime::shared_ptr cth) + (const vmime::shared_ptr & cth) { std::ostringstream oss; vmime::utility::outputStreamAdapter osa(oss); -- cgit