Fix unclear comments in translator

This commit is contained in:
PThorpe92
2025-05-07 22:37:25 -04:00
parent 7a5422ee30
commit c4aee50b58
2 changed files with 2 additions and 1 deletions

View File

@@ -2159,7 +2159,7 @@ pub fn translate_expr(
// this value into the proper order.
let index = program.parameters.push(name);
if let Some(ref mut indicies) = &mut program.param_positions {
// index of the parameter in the inserted values + index of the parameter relative
// (value_index, parameter_index)
indicies.push((program.current_col_idx.unwrap_or(index.get()), index));
}
program.emit_insn(Insn::Variable {

View File

@@ -648,6 +648,7 @@ fn populate_column_registers(
// if there are any parameter positions, we sort them by the value_index position
// to ensure we are binding the parameters to the proper index later on
if let Some(ref mut params) = program.param_positions.as_mut() {
// sort the tuples by the value_index position, leaving the param_index in right order.
params.sort_by_key(|(val_pos, _)| *val_pos);
let remap = params
.iter()