Skip to content

Commit 91260fc

Browse files
committed
Kill redundant JsString allocation
We don't need to create a JavaScript string object for property key.
1 parent 1968914 commit 91260fc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/statement.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ fn convert_row(
327327
.get_value(idx)
328328
.or_else(|err| throw_libsql_error(cx, err))?;
329329
let column_name = rows.column_name(idx).unwrap();
330-
let key = cx.string(column_name);
331330
let v: Handle<'_, JsValue> = match v {
332331
libsql::Value::Null => cx.null().upcast(),
333332
libsql::Value::Integer(v) => {
@@ -341,7 +340,7 @@ fn convert_row(
341340
libsql::Value::Text(v) => cx.string(v).upcast(),
342341
libsql::Value::Blob(v) => JsArrayBuffer::from_slice(cx, &v)?.upcast(),
343342
};
344-
result.set(cx, key, v)?;
343+
result.set(cx, column_name, v)?;
345344
}
346345
Ok(())
347346
}

0 commit comments

Comments
 (0)