diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-11-04 01:47:29 +0100 |
---|---|---|
committer | Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> | 2015-11-05 13:57:40 +0000 |
commit | 4d76352ae0ebb279989c73e8a8938c641ac42d77 (patch) | |
tree | 27e4cd0057b2da2ce55bb05a70973e2a91c7054b /src/corelib/codecs/qutfcodec.cpp | |
parent | d482a92858f181c76229dc977ee9c159ba36515f (diff) |
QUtf8: remove an unused variable
'need' was never anything but zero, so drop it.
Change-Id: I4b52107afc7ed47c19ae1942cef0c92cbd0e1a36
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'src/corelib/codecs/qutfcodec.cpp')
-rw-r--r-- | src/corelib/codecs/qutfcodec.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index 98d4b2e4e3..a64b3d167e 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -296,7 +296,6 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte { bool headerdone = false; ushort replacement = QChar::ReplacementCharacter; - int need = 0; int invalid = 0; int res; uchar ch = 0; @@ -311,7 +310,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte // 1 of 2 bytes invalid continuation +1 (need to insert replacement and restart) // 2 of 3 bytes same +1 (same) // 3 of 4 bytes same +1 (same) - QString result(need + len + 1, Qt::Uninitialized); + QString result(len + 1, Qt::Uninitialized); ushort *dst = reinterpret_cast<ushort *>(const_cast<QChar *>(result.constData())); const uchar *src = reinterpret_cast<const uchar *>(chars); |