From 16f927a4f1ffeff399351b625d73ac3cd7bccd51 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 19 Aug 2019 23:17:48 +0200 Subject: QLoggingRegistry: use QStringView/QLatin1String more - QLoggingRule::parse() and the ctor take pattern as QStringView - parseNextLine takes lines as QStringView and produces the pattern as QStringView for QLoggingRule - (setContent has to wait for QStringTokenizer) - QLoggingRule::pass()'s first argument is always QLatin1String, so take it as one Use chopped() more, add a std::move(). Change-Id: Ic95ea77464a9922fef452846bc6d5053bd5de56e Reviewed-by: Volker Hilsheimer --- src/corelib/io/qloggingregistry_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/io/qloggingregistry_p.h') diff --git a/src/corelib/io/qloggingregistry_p.h b/src/corelib/io/qloggingregistry_p.h index 12a1f166b3..3ac429b147 100644 --- a/src/corelib/io/qloggingregistry_p.h +++ b/src/corelib/io/qloggingregistry_p.h @@ -67,8 +67,8 @@ class Q_AUTOTEST_EXPORT QLoggingRule { public: QLoggingRule(); - QLoggingRule(const QStringRef &pattern, bool enabled); - int pass(const QString &categoryName, QtMsgType type) const; + QLoggingRule(QStringView pattern, bool enabled); + int pass(QLatin1String categoryName, QtMsgType type) const; enum PatternFlag { FullText = 0x1, @@ -84,7 +84,7 @@ public: bool enabled; private: - void parse(const QStringRef &pattern); + void parse(QStringView pattern); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QLoggingRule::PatternFlags) @@ -101,7 +101,7 @@ public: QVector rules() const { return _rules; } private: - void parseNextLine(QStringRef line); + void parseNextLine(QStringView line); private: bool m_inRulesSection = false; -- cgit v1.2.3