remove redundant QStringSplitter() members

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
Ivailo Monev 2019-12-30 05:23:19 +00:00
parent cf0b0ae659
commit 43f3a2a47b

View file

@ -57,28 +57,26 @@ class QStringSplitter
{
public:
QStringSplitter(const QString &s)
: m_string(s), m_data(m_string.constData()), m_len(s.length()), m_pos(0)
: m_string(s), m_pos(0)
{
m_splitChar = QLatin1Char('/');
}
inline bool hasNext() {
while (m_pos < m_len && m_data[m_pos] == m_splitChar)
while (m_pos < m_string.length() && m_string[m_pos] == m_splitChar)
++m_pos;
return m_pos < m_len;
return m_pos < m_string.length();
}
inline QStringRef next() {
int start = m_pos;
while (m_pos < m_len && m_data[m_pos] != m_splitChar)
while (m_pos < m_string.length() && m_string[m_pos] != m_splitChar)
++m_pos;
return QStringRef(&m_string, start, m_pos - start);
}
QString m_string;
const QChar *m_data;
QChar m_splitChar;
int m_len;
int m_pos;
};