Use explicit types with get_row

Auto types aren't very neat as return values because they move the burden
of knowledge to the reader. Using an explicit, and somewhat
self-explanatory, type makes it easier to assess the code without knowing
the implementation of the type.
This commit is contained in:
Markus Mäkelä
2018-04-12 11:15:44 +03:00
parent b6e421e13b
commit e3b11d866f
4 changed files with 8 additions and 6 deletions

View File

@ -525,9 +525,9 @@ int find_field(MYSQL* conn, const char* sql, const char* field_name, char* value
return ret;
}
std::vector<std::string> get_row(MYSQL* conn, std::string sql)
Row get_row(MYSQL* conn, std::string sql)
{
std::vector<std::string> rval;
Row rval;
MYSQL_RES* res;
if (mysql_query(conn, sql.c_str()) == 0 && (res = mysql_store_result(conn)))