summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2021-12-06 16:51:02 +0100
committerMarc Mutz <marc.mutz@qt.io>2021-12-07 09:06:19 +0100
commitab1180a2b0dd3124079162566da586e36f438ba5 (patch)
tree1e3a3e0607c28050a19d486fc6db0ca892c6517b /src
parent31f155d985f20f96043f339c115433e7e9edbaab (diff)
QVarLengthArray: merge remove(idx [,n]) into one function
remove(i) is the same as remove(i, 1), and the extra 'n' argument is of trivial type, so it's ok to default it instead of overloading. Change-Id: Id926cd63fde518e002684a41e055edc1004247a4 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qvarlengtharray.h7
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc10
2 files changed, 1 insertions, 16 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 123faba26d..5b8d77dab0 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -260,8 +260,7 @@ public:
void insert(qsizetype i, const T &t);
void insert(qsizetype i, qsizetype n, const T &t);
void replace(qsizetype i, const T &t);
- void remove(qsizetype i);
- void remove(qsizetype i, qsizetype n);
+ void remove(qsizetype i, qsizetype n = 1);
template <typename AT = T>
qsizetype removeAll(const AT &t);
template <typename AT = T>
@@ -598,10 +597,6 @@ inline void QVarLengthArray<T, Prealloc>::remove(qsizetype i, qsizetype n)
{ verify(i, n);
erase(begin() + i, begin() + i + n); }
template <class T, qsizetype Prealloc>
-inline void QVarLengthArray<T, Prealloc>::remove(qsizetype i)
-{ verify(i);
- erase(begin() + i, begin() + i + 1); }
-template <class T, qsizetype Prealloc>
template <typename AT>
inline qsizetype QVarLengthArray<T, Prealloc>::removeAll(const AT &t)
{ return QtPrivate::sequential_erase_with_copy(*this, t); }
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 0ba939ab60..b7e6cd6d6e 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -569,16 +569,6 @@
\sa operator[](), remove()
*/
-/*! \fn template<class T, qsizetype Prealloc> void QVarLengthArray<T, Prealloc>::remove(qsizetype i)
-
- \overload
- \since 4.8
-
- Removes the element at index position \a i.
-
- \sa insert(), replace()
-*/
-
/*! \fn template<class T, qsizetype Prealloc> void QVarLengthArray<T, Prealloc>::remove(qsizetype i, qsizetype count)
\overload