diff options
author | hjk <qtc-committer@nokia.com> | 2009-06-18 14:02:00 (GMT) |
---|---|---|
committer | hjk <qtc-committer@nokia.com> | 2009-06-18 14:29:53 (GMT) |
commit | e356eed2fa3d8e62085d6bd72caba9d11c40bacf (patch) | |
tree | 4411d57e71015f65fbdc631680271caefb8a0c3e /src/corelib/tools/qlocale.cpp | |
parent | d7005487b789e2bc5a1400148b4f317142a381ac (diff) | |
download | Qt-e356eed2fa3d8e62085d6bd72caba9d11c40bacf.zip Qt-e356eed2fa3d8e62085d6bd72caba9d11c40bacf.tar.gz Qt-e356eed2fa3d8e62085d6bd72caba9d11c40bacf.tar.bz2 |
Don't initialize data that will be overwritten immediately.
Reviewed-by: mariusSO
Diffstat (limited to 'src/corelib/tools/qlocale.cpp')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 52fb8a2..cbdd32c 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -185,8 +185,7 @@ static QString languageToCode(QLocale::Language language) const unsigned char *c = language_code_list + 3*(uint(language)); - QString code; - code.resize(c[2] == 0 ? 2 : 3); + QString code(c[2] == 0 ? 2 : 3, Qt::Uninitialized); code[0] = ushort(c[0]); code[1] = ushort(c[1]); @@ -201,8 +200,7 @@ static QString countryToCode(QLocale::Country country) if (country == QLocale::AnyCountry) return QString(); - QString code; - code.resize(2); + QString code(2, Qt::Uninitialized); const unsigned char *c = country_code_list + 2*(uint(country)); code[0] = ushort(c[0]); code[1] = ushort(c[1]); |