Skip to content

Commit 4f71c07

Browse files
committed
src: implement addaleax suggestions
1 parent d628a61 commit 4f71c07

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/node_sqlite.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,13 +1763,9 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) {
17631763

17641764
Local<Function> filterFunc = filterValue.As<Function>();
17651765

1766-
context.filterCallback =
1767-
[db, env, filterFunc](std::string_view item) -> bool {
1766+
context.filterCallback = [&](std::string_view item) -> bool {
17681767
Local<Value> argv[1];
1769-
if (!String::NewFromUtf8(env->isolate(),
1770-
item.data(),
1771-
NewStringType::kNormal,
1772-
static_cast<int>(item.size()))
1768+
if (!ToV8Value(env->context(), item, env->isolate())
17731769
.ToLocal(&argv[0])) {
17741770
db->SetIgnoreNextSQLiteError(true);
17751771
return false;

0 commit comments

Comments
 (0)