Commit 0f46893c authored by Volker Krause's avatar Volker Krause
Browse files

Port airport name normalization from QStringRef to QStringView

parent 4ef41c1e
Pipeline #77730 passed with stage
in 13 minutes and 55 seconds
......@@ -14,7 +14,7 @@
using namespace KItinerary;
static QString trimAirportName(const QStringRef &in)
static QString trimAirportName(QStringView in)
{
QString out = in.toString();
while (!out.isEmpty()) {
......@@ -40,14 +40,14 @@ static std::tuple<QString, QString> splitAirportName(const QString &name)
for (const auto &re : patterns) {
const auto match = re.match(name);
if (match.hasMatch()) {
const auto name = trimAirportName(match.capturedRef(1));
const auto name = trimAirportName(match.capturedView(1));
// try to recurse, sometimes this is indeed repeated...
QString recName;
QString recTerminal;
std::tie(recName, recTerminal) = splitAirportName(name);
if (recName == name || recTerminal.isEmpty()) {
return std::make_tuple(trimAirportName(match.capturedRef(1)), match.captured(2));
return std::make_tuple(trimAirportName(match.capturedView(1)), match.captured(2));
} else {
return std::make_tuple(recName, recTerminal);
}
......
Supports Markdown
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