Commit 90feaeb9 authored by Volker Krause's avatar Volker Krause
Browse files

Fix IFOPT merging if only one side has an identifier set

parent efe549da
Pipeline #64648 passed with stage
in 26 seconds
......@@ -72,6 +72,9 @@ private Q_SLOTS:
QCOMPARE(IfoptUtil::merge(s("de:08115:4512:5:B"), s("de:08115:4512:1:2")), s("de:08115:4512"));
QCOMPARE(IfoptUtil::merge(s("de:08115:4512:5:B"), s("de:08115:4512:5:B")), s("de:08115:4512:5:B"));
QCOMPARE(IfoptUtil::merge(s("de:08115:4512"), s("de:08115:4512")), s("de:08115:4512"));
QCOMPARE(IfoptUtil::merge(QString(), s("de:08115:4512")), s("de:08115:4512"));
QCOMPARE(IfoptUtil::merge(s("de:08115:4512"), QString()), s("de:08115:4512"));
}
};
......
......@@ -62,6 +62,13 @@ bool IfoptUtil::isSameStopPlace(QStringView lhs, QStringView rhs)
QStringView IfoptUtil::merge(QStringView lhs, QStringView rhs)
{
if (lhs.isEmpty()) {
return rhs;
}
if (rhs.isEmpty()) {
return lhs;
}
if (lhs == rhs) {
return lhs;
}
......
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