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>
This commit is contained in:
parent
baf0933415
commit
a7f2c32657
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user