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

@@ -177,7 +177,6 @@ pub unsafe fn dc_get_msg_info(context: &Context, msg_id: u32) -> *mut libc::c_ch
context,
"SELECT txt_raw FROM msgs WHERE id=?;",
params![msg_id as i32],
0,
);
if rawtxt.is_none() {
@@ -495,7 +494,6 @@ pub unsafe fn dc_get_mime_headers(context: &Context, msg_id: u32) -> *mut libc::
context,
"SELECT mime_headers FROM msgs WHERE id=?;",
params![msg_id as i32],
0,
);
if let Some(headers) = headers {
@@ -1012,7 +1010,6 @@ pub fn dc_msg_exists(context: &Context, msg_id: u32) -> bool {
context,
"SELECT chat_id FROM msgs WHERE id=?;",
params![msg_id],
0,
);
if let Some(chat_id) = chat_id {
@@ -1135,7 +1132,6 @@ pub unsafe fn dc_mdn_from_ext(
context,
"SELECT COUNT(*) FROM msgs_mdns WHERE msg_id=?;",
params![*ret_msg_id as i32],
0,
)
.unwrap_or_default();
/*