Remove clone in vtab from_args

This commit is contained in:
PThorpe92 2025-02-17 21:31:27 -05:00
parent e63436dc47
commit 9b742e1a76
No known key found for this signature in database
GPG key ID: 66DB3FBACBDD05CC
4 changed files with 9 additions and 6 deletions

View file

@ -532,7 +532,7 @@ impl VirtualTable {
args: Vec<limbo_ext::Value>,
syms: &SymbolTable,
kind: VTabKind,
exprs: &Option<Vec<ast::Expr>>,
exprs: Option<Vec<ast::Expr>>,
) -> Result<Rc<Self>> {
let module = syms
.vtab_modules
@ -559,7 +559,7 @@ impl VirtualTable {
name: tbl_name.unwrap_or(module_name).to_owned(),
implementation: module.implementation.clone(),
columns,
args: exprs.clone(),
args: exprs,
});
return Ok(vtab);
}

View file

@ -376,9 +376,12 @@ fn parse_from_clause_table<'a>(
.push(TableReference::new_subquery(identifier, subplan, None));
Ok(())
}
ast::SelectTable::TableCall(qualified_name, ref maybe_args, maybe_alias) => {
ast::SelectTable::TableCall(qualified_name, maybe_args, maybe_alias) => {
let normalized_name = &normalize_ident(qualified_name.name.0.as_str());
let args = vtable_args(maybe_args.as_ref().unwrap_or(&vec![]).as_slice());
let args = match maybe_args {
Some(ref args) => vtable_args(args),
None => vec![],
};
let vtab = crate::VirtualTable::from_args(
None,
normalized_name,

View file

@ -906,7 +906,7 @@ impl Program {
args,
&conn.db.syms.borrow(),
limbo_ext::VTabKind::VirtualTable,
&None,
None,
)?;
{
conn.db

View file

@ -142,7 +142,7 @@ def test_output_file():
expected_lines = {
f"Output: {output_filename}": "Can direct output to a file",
"Output mode: raw": "Output mode remains raw when output is redirected",
"Output mode: list": "Output mode remains list when output is redirected",
"Error: pretty output can only be written to a tty": "Error message for pretty mode",
"SELECT 'TEST_ECHO'": "Echoed command",
"TEST_ECHO": "Echoed result",