Raytracing: QString::indexOf is now marked as [[nodiscard]]

This commit is contained in:
wmayer
2022-11-05 15:09:52 +01:00
parent 81d2361d9f
commit 4bd0d20812
2 changed files with 5 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <boost/core/ignore_unused.hpp>
# include <QRegularExpression>
# include <QRegularExpressionMatch>
#endif
@@ -98,7 +99,7 @@ void PovrayHighlighter::highlightBlock(const QString &text)
else if (text.mid(i,1) == QLatin1String("#")) {
QRegularExpression rx(QLatin1String("#\\s*(\\w*)"));
QRegularExpressionMatch match;
text.indexOf(rx, i, &match);
boost::ignore_unused(text.indexOf(rx, i, &match));
if (match.hasMatch()) {
if (d->keywords.contains(match.captured(1)) != 0)
setFormat(i, match.capturedLength(), this->colorByType(SyntaxHighlighter::Keyword));

View File

@@ -35,6 +35,9 @@
#include <sstream>
#include <vector>
// Boost
#include <boost/core/ignore_unused.hpp>
#ifdef FC_OS_WIN32
# include <windows.h>
#endif