aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/ftw/qhashedstring.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-06-25 21:53:06 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-28 14:55:55 +0200
commit4a3d5537dde71c57378da7e65e732d50f88e592a (patch)
tree066bd56f26a43b08478f17a5a10c716e5c6a811e /src/qml/qml/ftw/qhashedstring.cpp
parentdfbec73b35cc600be0614081a0ef280d53a1c79e (diff)
Remove an overoptimisation that was only used (wrongly) in one place
Let's simplify this code. The goal is to replace most of the code in qhashedstring with an identifier based hash table. Change-Id: I2f9a38ad0bb2f43a2b2b87914823c23ed231f48c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/ftw/qhashedstring.cpp')
-rw-r--r--src/qml/qml/ftw/qhashedstring.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/qml/qml/ftw/qhashedstring.cpp b/src/qml/qml/ftw/qhashedstring.cpp
index 99f342f6f0..0af68e89f6 100644
--- a/src/qml/qml/ftw/qhashedstring.cpp
+++ b/src/qml/qml/ftw/qhashedstring.cpp
@@ -341,14 +341,6 @@ static void utf8FromUtf16(char *output, const QChar *uc, int len)
}
}
-void QHashedStringRef::computeUtf8Length() const
-{
- if (m_length)
- m_utf8length = utf8LengthFromUtf16(m_data, m_length);
- else
- m_utf8length = 0;
-}
-
QHashedStringRef QHashedStringRef::mid(int offset, int length) const
{
Q_ASSERT(offset < m_length);
@@ -396,33 +388,6 @@ QString QHashedStringRef::toString() const
return QString(m_data, m_length);
}
-QByteArray QHashedStringRef::toUtf8() const
-{
- if (m_length == 0)
- return QByteArray();
-
- QByteArray result;
- result.resize(utf8length());
- writeUtf8(result.data());
- return result;
-}
-
-void QHashedStringRef::writeUtf8(char *output) const
-{
- if (m_length) {
- int ulen = utf8length();
- if (ulen == m_length) {
- // Must be a latin1 string
- uchar *o = (uchar *)output;
- const QChar *c = m_data;
- while (ulen--)
- *o++ = (uchar)((*c++).unicode());
- } else {
- utf8FromUtf16(output, m_data, m_length);
- }
- }
-}
-
QString QHashedCStringRef::toUtf16() const
{
if (m_length == 0)