QStringTokenizer: use sliced() instead of mid()

The code was developed against the narrow-contract version of mid(),
but not updated when mid() became wide-contract.

Change-Id: I038054fb3f5acc0085c48fbf36af13dd14c917b8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Marc Mutz 2020-06-25 15:01:32 +02:00
parent e2be114f64
commit dcf856ca7a
1 changed files with 2 additions and 2 deletions

View File

@ -416,13 +416,13 @@ auto QStringTokenizerBase<Haystack, Needle>::next(tokenizer_state state) const n
Haystack result;
if (state.end >= 0) {
// token separator found => return intermediate element:
result = m_haystack.mid(state.start, state.end - state.start);
result = m_haystack.sliced(state.start, state.end - state.start);
const auto ns = QtPrivate::Tok::size(m_needle);
state.start = state.end + ns;
state.extra = (ns == 0 ? 1 : 0);
} else {
// token separator not found => return final element:
result = m_haystack.mid(state.start);
result = m_haystack.sliced(state.start);
}
if ((m_sb & Qt::SkipEmptyParts) && result.isEmpty())
continue;