Prevent double allocations for VFilter args in vdbe

This commit is contained in:
PThorpe92 2025-04-17 13:11:21 -04:00
parent e17fd7edc4
commit d53c60e071
No known key found for this signature in database
GPG key ID: 66DB3FBACBDD05CC
2 changed files with 12 additions and 10 deletions

View file

@ -979,9 +979,14 @@ pub fn op_vfilter(
let has_rows = {
let mut cursor = state.get_cursor(*cursor_id);
let cursor = cursor.as_virtual_mut();
let mut args = Vec::new();
let mut args = Vec::with_capacity(*arg_count);
for i in 0..*arg_count {
args.push(state.registers[args_reg + i].get_owned_value().clone());
args.push(
state.registers[args_reg + i]
.get_owned_value()
.clone()
.to_ffi(),
);
}
let idx_str = if let Some(idx_str) = idx_str {
Some(state.registers[*idx_str].get_owned_value().to_string())