db.hh: use hasPrefix for prefix comparisons
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
This commit is contained in:
parent
62b2880dfc
commit
e4cda87b5a
|
@ -17,8 +17,7 @@ struct Connection : pqxx::connection
|
||||||
std::string lower_prefix = "dbi:Pg:";
|
std::string lower_prefix = "dbi:Pg:";
|
||||||
std::string upper_prefix = "DBI:Pg:";
|
std::string upper_prefix = "DBI:Pg:";
|
||||||
|
|
||||||
if ((std::string(s, 0, lower_prefix.size()) == lower_prefix) ||
|
if (hasPrefix(s, lower_prefix) || hasPrefix(s, upper_prefix)) {
|
||||||
(std::string(s, 0, upper_prefix.size()) == upper_prefix)) {
|
|
||||||
return concatStringsSep(" ", tokenizeString<Strings>(string(s, lower_prefix.size()), ";"));
|
return concatStringsSep(" ", tokenizeString<Strings>(string(s, lower_prefix.size()), ";"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue