summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-10-30 13:42:09 +0100
committerLars Knoll <lars.knoll@qt.io>2020-11-04 11:21:37 +0100
commit32a703e2779e697a9a7d75f6cbc6e555187d7fca (patch)
treeea9d56952efd13d36ae455771ace6fa144bbe568 /src/corelib/text/qstring.cpp
parent50ec3252ac5d61a13fab01801ef42729d6f3a7c6 (diff)
Don't move data in QArrayDataOps::reallocate()
reallocate() should only ever call realloc(), and only be used to create more space at the end of the data. Change-Id: I2ac4dbc90d2afaa571bb620108d7984356712cb2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 51af7fe32a..3e6188a38d 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -2516,7 +2516,7 @@ void QString::reallocData(qsizetype alloc, Data::ArrayOptions allocOptions)
dd.data()[dd.size] = 0;
d = dd;
} else {
- d->reallocate(alloc, allocOptions);
+ d->reallocate(alloc);
}
}
@@ -2531,7 +2531,7 @@ void QString::reallocGrowData(qsizetype n)
dd.data()[dd.size] = 0;
d = dd;
} else {
- d->reallocate(d.constAllocatedCapacity() + n, Data::GrowsForward);
+ d->reallocate(d.constAllocatedCapacity() + n);
}
}