Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
0f46893c
Commit
0f46893c
authored
Sep 01, 2021
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/extractorutil.cpp
View file @
0f46893c
...
...
@@ -14,7 +14,7 @@
using
namespace
KItinerary
;
static
QString
trimAirportName
(
const
QString
Ref
&
in
)
static
QString
trimAirportName
(
QString
View
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
.
captured
Ref
(
1
));
const
auto
name
=
trimAirportName
(
match
.
captured
View
(
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
.
captured
Ref
(
1
)),
match
.
captured
(
2
));
return
std
::
make_tuple
(
trimAirportName
(
match
.
captured
View
(
1
)),
match
.
captured
(
2
));
}
else
{
return
std
::
make_tuple
(
recName
,
recTerminal
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment