summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qcollator.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2018-07-11 18:08:55 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2018-08-13 14:15:29 +0000
commita7f2c32657b791b5ac470ca9ff5358e15b6817da (patch)
tree3cea964c3f2d3366dd5626826502cb29b3a028bc /src/corelib/tools/qcollator.cpp
parentbaf0933415153daaeb9387dd2f6ea5da84bef04f (diff)
Don't duplicate things the constructor has done
QCollator::detach() created a new QCollatorPrivate, then set some of its fields to the values its constructor sets them to. Don't waste time doing that. Change-Id: I048a1553753ae2cf03d3f61d45490f2723ee658b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qcollator.cpp')
-rw-r--r--src/corelib/tools/qcollator.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index 2e231003b7..a198208966 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -159,9 +159,7 @@ void QCollator::detach()
{
if (d->ref.load() != 1) {
QCollatorPrivate *x = new QCollatorPrivate;
- x->ref.store(1);
x->locale = d->locale;
- x->collator = 0;
if (!d->ref.deref())
delete d;
d = x;