From c0e1a38f69cb3bc43649c7a45896b1fcf807279a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 12 Nov 2020 12:56:11 +0100 Subject: Remove the special code for emplaceFront/Back again emplace() itself now handles those cases fast enough, so there should not be a need to add special code paths for those methods. Change-Id: I3277eb77dd54194e46f96f24de44d7785a6f860a Reviewed-by: Andrei Golubev Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/auto/corelib/tools') diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index 3bad143af5..94ed26710f 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -2205,7 +2205,7 @@ void tst_QArrayData::selfEmplaceBackwards() const auto testSelfEmplace = [&](auto dummy, int spaceAtEnd, auto initValues) { auto adp = createDataPointer(100, spaceAtEnd, dummy); for (auto v : initValues) { - adp->emplaceBack(v); + adp->emplace(adp.size, v); } QVERIFY(!adp.freeSpaceAtEnd()); QVERIFY(adp.freeSpaceAtBegin()); @@ -2244,11 +2244,12 @@ void tst_QArrayData::selfEmplaceForward() }; const auto testSelfEmplace = [&](auto dummy, int spaceAtBegin, auto initValues) { - auto adp = createDataPointer(100, spaceAtBegin, dummy); + // need a -1 below as the first emplace will go towards the end (as the array is still empty) + auto adp = createDataPointer(100, spaceAtBegin - 1, dummy); auto reversedInitValues = initValues; std::reverse(reversedInitValues.begin(), reversedInitValues.end()); for (auto v : reversedInitValues) { - adp->emplaceFront(v); + adp->emplace(0, v); } QVERIFY(!adp.freeSpaceAtBegin()); QVERIFY(adp.freeSpaceAtEnd()); -- cgit v1.2.3