From c4aee50b58488737ec33837d7d83adf4da68d0d2 Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Wed, 7 May 2025 22:37:25 -0400 Subject: [PATCH] Fix unclear comments in translator --- core/translate/expr.rs | 2 +- core/translate/insert.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/translate/expr.rs b/core/translate/expr.rs index 37c25c401..ed52c1675 100644 --- a/core/translate/expr.rs +++ b/core/translate/expr.rs @@ -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 { diff --git a/core/translate/insert.rs b/core/translate/insert.rs index e05030cb3..c9ed37005 100644 --- a/core/translate/insert.rs +++ b/core/translate/insert.rs @@ -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()