[feed_info.c] Add clarifying comments

Looking back at this code, it confused me for a second as to why I was throwing out the result of this function, so I added a comment.
This commit is contained in:
2024-12-11 01:18:44 -05:00
parent 4f3e00cb53
commit 3e6089944d

View File

@ -81,12 +81,12 @@ zblock_feed_info_err zblock_feed_info_retrieve_list_item(PGconn *conn, zblock_fe
if (PQresultStatus(res) != PGRES_TUPLES_OK) { if (PQresultStatus(res) != PGRES_TUPLES_OK) {
log_error("Unable to retrieve feeds: %s", PQresultErrorMessage(res)); log_error("Unable to retrieve feeds: %s", PQresultErrorMessage(res));
PQclear(res); PQclear(res);
PQgetResult(conn); PQgetResult(conn); // thrown out because it should be null
return ZBLOCK_FEED_INFO_DBERROR; return ZBLOCK_FEED_INFO_DBERROR;
} else { } else {
PQclear(res); PQclear(res);
// we need to do this one last time or the next query won't work // we need to do this one last time or the next query won't work
PQgetResult(conn); PQgetResult(conn); // thrown out because it should be null
return ZBLOCK_FEED_INFO_FINISHED; return ZBLOCK_FEED_INFO_FINISHED;
} }
} }