1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

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
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