|
5 | 5 |
|
6 | 6 | #include <cassert> |
7 | 7 |
|
8 | | -const QSet<QString> CDebugHighlighter::s_keywords{ |
| 8 | +const QSet<QStringView> CDebugHighlighter::s_keywords{ |
9 | 9 | QStringLiteral("_Align"), |
10 | 10 | QStringLiteral("_At"), |
11 | 11 | QStringLiteral("auto"), |
@@ -151,7 +151,7 @@ void CDebugHighlighter::highlightBlock(const QString &text) { |
151 | 151 | [[gnu::fallthrough]]; |
152 | 152 | case ParseState::PreprocessorInstruction: |
153 | 153 | if (c == ' ' || c == '\t') { |
154 | | - QStringRef instruction = text.midRef(start, i - start); |
| 154 | + QStringView instruction = text.mid(start, i - start); |
155 | 155 | if (instruction == QStringLiteral("include")) { |
156 | 156 | state = ParseState::PreprocessorInclude; |
157 | 157 | } else if (instruction == QStringLiteral("if")) { |
@@ -198,7 +198,7 @@ void CDebugHighlighter::highlightBlock(const QString &text) { |
198 | 198 | if (i == text.length() || |
199 | 199 | ((c < '0' || c > '9') && (c < 'A' || c > 'Z') && |
200 | 200 | c != '_' && (c < 'a' || c > 'z'))) { |
201 | | - QStringRef token = text.midRef(start, i - start); |
| 201 | + QStringView token = text.mid(start, i - start); |
202 | 202 | if (state == ParseState::NumberLiteral) { |
203 | 203 | if (c == '.' || ((c == '+' || c == '-') && i > start && |
204 | 204 | (text[i - 1] == 'E' || text[i - 1] == 'e'))) { |
@@ -240,7 +240,7 @@ void CDebugHighlighter::highlightBlock(const QString &text) { |
240 | 240 | : m_sources->m_errorFormat); |
241 | 241 | } else { |
242 | 242 | setFormat(start, i - start, |
243 | | - s_keywords.contains(token.toString()) ? |
| 243 | + s_keywords.contains(token) ? |
244 | 244 | m_sources->m_keywordFormat : |
245 | 245 | m_sources->m_identifierFormat); |
246 | 246 | } |
|
0 commit comments