Commit 11bc54ac authored by Volker Krause's avatar Volker Krause
Browse files

Prefer longer ticket tokens when merging

Some codes like IATA BCBP or those of Renfe can have a common prefix
and additional details appended.
parent 552e91ac
......@@ -529,6 +529,9 @@ static Ticket mergeValue(const Ticket &lhs, const Ticket &rhs)
// prefer barcode ticket tokens over URLs
if (t.ticketTokenType() == Token::Url && lhs.ticketTokenType() != Token::Url && lhs.ticketTokenType() != Token::Unknown) {
t.setTicketToken(lhs.ticketToken());
} else if (lhs.ticketTokenType() != Token::Url && rhs.ticketTokenType() != Token::Url
&& lhs.ticketTokenType() != Token::Unknown && rhs.ticketTokenType() != Token::Unknown) {
t.setTicketToken(ticketTokenSize(lhs.ticketTokenData()) > ticketTokenSize(rhs.ticketTokenData()) ? lhs.ticketToken() : rhs.ticketToken());
}
return t;
}
......
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