summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-06-29 13:22:30 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-06-30 18:54:57 +0200
commitb1ec50c96df0fcfbcf18281ca5d7e1e52dbca5f6 (patch)
tree09f0db3d5155a2391854a816fb9adcd8a52d33a1
parent5fa016f28489cb175f8a2abd53988cd7d6892f58 (diff)
QByteArray::insert: do not assert that pos must be non-negative
The insert() overloads have generally a very wide contract. The very next line accepts negative positions, so remove the related assert. Change-Id: I89b67615c59287825942047a28572bf896cf30e3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/text/qbytearray.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index 2b46bf734d..77f4110601 100644
--- a/src/corelib/text/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -1911,8 +1911,6 @@ QByteArray& QByteArray::append(char ch)
static inline QByteArray &qbytearray_insert(QByteArray *ba,
int pos, const char *arr, int len)
{
- Q_ASSERT(pos >= 0);
-
if (pos < 0 || len <= 0 || arr == nullptr)
return *ba;