From 4dc06bdb7034d36071caa2219f14c4b2ce52c80a Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Wed, 15 Mar 2017 13:38:19 +0100 Subject: [PATCH] Use bulk vector::insert rather than back_inserter --- include/internal/catch_generators.hpp | 3 +-- include/internal/catch_test_case_tracker.hpp | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/internal/catch_generators.hpp b/include/internal/catch_generators.hpp index 84eb22f..a9ba7eb 100644 --- a/include/internal/catch_generators.hpp +++ b/include/internal/catch_generators.hpp @@ -10,7 +10,6 @@ #include "catch_context.h" -#include #include #include #include @@ -124,7 +123,7 @@ public: private: void move( CompositeGenerator& other ) { - std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) ); + m_composed.insert( m_composed.end(), other.m_composed.begin(), other.m_composed.end() ); m_totalSize += other.m_totalSize; other.m_composed.clear(); } diff --git a/include/internal/catch_test_case_tracker.hpp b/include/internal/catch_test_case_tracker.hpp index 9526e28..f1ab0fe 100644 --- a/include/internal/catch_test_case_tracker.hpp +++ b/include/internal/catch_test_case_tracker.hpp @@ -11,11 +11,10 @@ #include "catch_compiler_capabilities.h" #include "catch_ptr.hpp" -#include +#include #include #include #include -#include #include namespace Catch { @@ -290,12 +289,12 @@ namespace TestCaseTracking { if( !filters.empty() ) { m_filters.push_back(""); // Root - should never be consulted m_filters.push_back(""); // Test Case - not a section filter - std::copy( filters.begin(), filters.end(), std::back_inserter( m_filters ) ); + m_filters.insert( m_filters.end(), filters.begin(), filters.end() ); } } void addNextFilters( std::vector const& filters ) { if( filters.size() > 1 ) - std::copy( filters.begin()+1, filters.end(), std::back_inserter( m_filters ) ); + m_filters.insert( m_filters.end(), ++filters.begin(), filters.end() ); } };