From a7f2c32657b791b5ac470ca9ff5358e15b6817da Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 11 Jul 2018 18:08:55 +0200 Subject: 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 --- src/corelib/tools/qcollator.cpp | 2 -- 1 file changed, 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; -- cgit v1.2.3