Use QStringRef overload for string streaming

GIT_SILENT
parent d0017db9
......@@ -246,7 +246,7 @@ QString ClangUtils::getCursorSignature(CXCursor cursor, const QString& scope, co
QString functionName = ClangString(clang_getCursorSpelling(cursor)).toString();
if (functionName.contains(QLatin1Char('<'))) {
stream << functionName.left(functionName.indexOf(QLatin1Char('<')));
stream << functionName.leftRef(functionName.indexOf(QLatin1Char('<')));
} else {
stream << functionName;
}
......@@ -285,7 +285,7 @@ QString ClangUtils::getCursorSignature(CXCursor cursor, const QString& scope, co
//KDevelop formats them as "t* x" and "t& x". Make that adjustment.
const QString type = ClangString(clang_getTypeSpelling(clang_getCursorType(arg))).toString();
if (type.endsWith(QLatin1String(" *")) || type.endsWith(QLatin1String(" &"))) {
stream << type.left(type.length() - 2) << type.at(type.length() - 1);
stream << type.leftRef(type.length() - 2) << type.at(type.length() - 1);
} else {
stream << type;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment