Simplify Sql.query_row_col function

Function `query_row` executes query and calls callback function to process
row returned. Function query_row_col() is special case, that provides
callback function, which returns value of one particular column of row,
ignoring others.

In all cases, that particular column was 0 (first and only column of
query result), since there is no point to select more than one column
with this function -- they are discarded anyway.

This commit removes that redundancy, removing column number argument of
query_row_col() function and adjusting call sites accordingly.
This commit is contained in:
Dmitry Bogatov
2019-09-12 05:01:06 +00:00
parent 500e80784a
commit cdfc7281d0
13 changed files with 3 additions and 39 deletions

View File

@@ -305,7 +305,6 @@ pub fn dc_get_archived_cnt(context: &Context) -> u32 {
context,
"SELECT COUNT(*) FROM chats WHERE blocked=0 AND archived=1;",
params![],
0,
)
.unwrap_or_default()
}
@@ -323,7 +322,6 @@ fn get_last_deaddrop_fresh_msg(context: &Context) -> u32 {
AND c.blocked=2 \
ORDER BY m.timestamp DESC, m.id DESC;",
params![],
0,
)
.unwrap_or_default()
}