From 4efd2ebb27bf0ed2d2a9f472c5b163640be195e6 Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Wed, 7 Jul 2010 12:39:17 +0200 Subject: [PATCH] RegistryKey: Move member variable initialization to the ctor-init-list In cause of doubt this is more efficient, see https://isocpp.org/wiki/faq/ctors#init-lists This also fixes the initialization order to match the declarartion order of the variables in the class which some versions of GCC otherwise would complain about. Change-Id: I642f7156d624c2c65f2f3525d813f5289c092f96 Reviewed-by: Marc Mutz Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/corelib/io/qsettings_win.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp index 60b15f41a0..1546219c3b 100644 --- a/src/corelib/io/qsettings_win.cpp +++ b/src/corelib/io/qsettings_win.cpp @@ -319,11 +319,11 @@ private: }; RegistryKey::RegistryKey(HKEY parent_handle, const QString &key, bool read_only) + : m_parent_handle(parent_handle), + m_handle(0), + m_key(key), + m_read_only(read_only) { - m_parent_handle = parent_handle; - m_handle = 0; - m_read_only = read_only; - m_key = key; } QString RegistryKey::key() const