LibSQL: Copy SQL::Value instances less frequently (which may be vectors)

This commit is contained in:
Timothy Flynn
2022-09-21 13:47:02 -04:00
committed by Ali Mohammad Pur
parent 5f549fe5d9
commit c0b54f18b5
Notes: sideshowbarker 2024-07-17 05:48:37 +09:00
3 changed files with 10 additions and 8 deletions

View File

@@ -40,12 +40,13 @@ ResultOr<Value> NestedExpression::evaluate(ExecutionContext& context) const
ResultOr<Value> ChainedExpression::evaluate(ExecutionContext& context) const
{
Value ret(SQLType::Tuple);
Vector<Value> values;
TRY(values.try_ensure_capacity(expressions().size()));
for (auto& expression : expressions())
values.append(TRY(expression.evaluate(context)));
ret = values;
return ret;
values.unchecked_append(TRY(expression.evaluate(context)));
return Value { move(values) };
}
ResultOr<Value> BinaryOperatorExpression::evaluate(ExecutionContext& context) const