From 50ab31a5dfe491510e194e58075b648fd0b47e6a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 25 Apr 2013 22:19:02 -0700 Subject: QLocalePrivate: remove QLocalePrivate::m_index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not used anywhere, so we don't need to cache the locale data index. We already have the pointer to the QLocaleData anyway. This saves us a few roundtrips calculating the index from the data pointer only to get the data pointer again. Change-Id: I6905d20a382ddcb9fb04cc886a17499b467f905a Reviewed-by: Robin Burchell Reviewed-by: Lars Knoll Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qlocale_p.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/corelib/tools/qlocale_p.h') diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h index 9674342307..9ed1b6bf76 100644 --- a/src/corelib/tools/qlocale_p.h +++ b/src/corelib/tools/qlocale_p.h @@ -208,10 +208,9 @@ public: class Q_CORE_EXPORT QLocalePrivate : public QSharedData { public: - explicit QLocalePrivate(int index, int numberOptions = 0) - : m_index(index), m_numberOptions(numberOptions) + explicit QLocalePrivate(const QLocaleData *data, int numberOptions = 0) + : m_data(data), m_numberOptions(numberOptions) { - m_data = dataPointerForIndex(index); } ~QLocalePrivate() @@ -332,9 +331,8 @@ public: QString dateTimeToString(const QString &format, const QDate *date, const QTime *time, const QLocale *q) const; - quint16 m_index; - quint16 m_numberOptions; const QLocaleData *m_data; + quint16 m_numberOptions; }; inline char QLocalePrivate::digitToCLocale(QChar in) const -- cgit v1.2.3