From c39d2ab482c1f11e30d7a80f92d65c4982a12703 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 11 Jul 2018 18:21:31 +0200 Subject: [PATCH] QCollatorPrivate: initialize in declarations rather than constructor Change-Id: If5f240418e6a538ef44af973929b5c84e63b70d8 Reviewed-by: Thiago Macieira --- src/corelib/tools/qcollator_p.h | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/tools/qcollator_p.h index c03a3431db..71095f845d 100644 --- a/src/corelib/tools/qcollator_p.h +++ b/src/corelib/tools/qcollator_p.h @@ -88,7 +88,7 @@ typedef int CollatorType; class QCollatorPrivate { public: - QAtomicInt ref; + QAtomicInt ref = 1; QLocale locale; #if defined(Q_OS_WIN) && !QT_CONFIG(icu) #ifdef USE_COMPARESTRINGEX @@ -97,12 +97,12 @@ public: LCID localeID; #endif #endif - Qt::CaseSensitivity caseSensitivity; - bool numericMode; - bool ignorePunctuation; - bool dirty; + Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive; + bool numericMode = false; + bool ignorePunctuation = false; + bool dirty = true; - CollatorType collator; + CollatorType collator = 0; void clear() { cleanup(); @@ -113,12 +113,6 @@ public: void cleanup(); QCollatorPrivate() - : ref(1), - caseSensitivity(Qt::CaseSensitive), - numericMode(false), - ignorePunctuation(false), - dirty(true), - collator(0) { cleanup(); } ~QCollatorPrivate() { cleanup(); }