diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-11-12 16:41:58 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-11-17 11:47:36 +0100 |
commit | 996255baae06310b09892f4376fb8b3227ecbb70 (patch) | |
tree | 4f9bc12f20763c9e12865d533853d0a1cdd5bbe4 /tests/auto/corelib | |
parent | c0e1a38f69cb3bc43649c7a45896b1fcf807279a (diff) |
Fix signature of QArrayDataOps::erase()
Bring it in line with the other methods that also take a
pointer and a size.
Also use truncate() in removeAll() as that's more efficient
for the use case.
Change-Id: Ib1073b7c048ceb96fb6391b308ef8feb77896866
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/tools/qarraydata/simplevector.h | 2 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/corelib/tools/qarraydata/simplevector.h b/tests/auto/corelib/tools/qarraydata/simplevector.h index 1dc9be765c..74227dd8d0 100644 --- a/tests/auto/corelib/tools/qarraydata/simplevector.h +++ b/tests/auto/corelib/tools/qarraydata/simplevector.h @@ -274,7 +274,7 @@ public: if (last == end) d->truncate(end - first); else - d->erase(first, last); + d->erase(first, last - first); } void swap(SimpleVector &other) diff --git a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp index 94ed26710f..3dcaba4759 100644 --- a/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp +++ b/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp @@ -1666,7 +1666,7 @@ void tst_QArrayData::arrayOpsExtra() const size_t pos = std::distance(dataPointer.begin(), first); auto copy = cloneArrayDataPointer(dataPointer, dataPointer.size); - dataPointer->erase(first, last); + dataPointer->erase(first, last - first); QCOMPARE(size_t(dataPointer.size), originalSize - distance); size_t i = 0; for (; i < pos; ++i) |