diff --git a/src/libhydra/db.hh b/src/libhydra/db.hh index ec9a024b..7d5bdc58 100644 --- a/src/libhydra/db.hh +++ b/src/libhydra/db.hh @@ -17,8 +17,7 @@ struct Connection : pqxx::connection std::string lower_prefix = "dbi:Pg:"; std::string upper_prefix = "DBI:Pg:"; - if ((std::string(s, 0, lower_prefix.size()) == lower_prefix) || - (std::string(s, 0, upper_prefix.size()) == upper_prefix)) { + if (hasPrefix(s, lower_prefix) || hasPrefix(s, upper_prefix)) { return concatStringsSep(" ", tokenizeString(string(s, lower_prefix.size()), ";")); }