diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2020-06-03 13:57:32 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2020-06-08 20:22:01 +0200 |
commit | f8661b035e89e60016519018c135fb6275671b49 (patch) | |
tree | 5a2236f78eb4ab5fbe06d9fa6213d6f944c4bb99 | |
parent | 34442a23f68a427aea276a419927c005a70bef8f (diff) |
Port QtMqtt from QStringRef to QStringView
Task-number: QTBUG-84319
Change-Id: I2184c8ba15f9e9671f9b8f404e6a5d5054bea3bb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r-- | src/mqtt/qmqtttopicfilter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mqtt/qmqtttopicfilter.cpp b/src/mqtt/qmqtttopicfilter.cpp index eb99d8e..710ddc2 100644 --- a/src/mqtt/qmqtttopicfilter.cpp +++ b/src/mqtt/qmqtttopicfilter.cpp @@ -234,19 +234,19 @@ bool QMqttTopicFilter::match(const QMqttTopicName &name, MatchOptions matchOptio } if (d->filter.endsWith(QLatin1Char('#'))) { - QStringRef root = d->filter.leftRef(d->filter.size() - 1); + QStringView root = QStringView{d->filter}.left(d->filter.size() - 1); if (root.endsWith(QLatin1Char('/'))) // '#' also represents the parent level! root = root.left(root.size() - 1); return topic.startsWith(root); } if (d->filter.contains(QLatin1Char('+'))) { - const QVector<QStringRef> filterLevels = d->filter.splitRef(QLatin1Char('/')); - const QVector<QStringRef> topicLevels = topic.splitRef(QLatin1Char('/')); + const QVector<QStringView> filterLevels = QStringView{d->filter}.split(QLatin1Char('/')); + const QVector<QStringView> topicLevels = QStringView{topic}.split(QLatin1Char('/')); if (filterLevels.size() != topicLevels.size()) return false; for (int i = 0; i < filterLevels.size(); ++i) { - const QStringRef &level = filterLevels.at(i); + const auto &level = filterLevels.at(i); if (level != QLatin1Char('+') && level != topicLevels.at(i)) return false; } |