mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:42:31 -05:00
src,sqlite: only pass xFilter when user provided a callback
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/63516 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
This commit is contained in:
1 parent
f159ad29d2
commit
310f60a6f9
1 file changed
+1
-2
+1
-2
@@ -1647,7 +1647,6 @@ static int xConflict(void* pCtx, int eConflict, sqlite3_changeset_iter* pIter) {
|
||||
|
||||
static int xFilter(void* pCtx, const char* zTab) {
|
||||
auto ctx = static_cast<ConflictCallbackContext*>(pCtx);
|
||||
if (!ctx->filterCallback) return 1;
|
||||
return ctx->filterCallback(zTab) ? 1 : 0;
|
||||
}
|
||||
|
||||
@@ -1751,7 +1750,7 @@ void DatabaseSync::ApplyChangeset(const FunctionCallbackInfo<Value>& args) {
|
||||
db->connection_,
|
||||
buf.length(),
|
||||
const_cast<void*>(static_cast<const void*>(buf.data())),
|
||||
xFilter,
|
||||
context.filterCallback ? xFilter : nullptr,
|
||||
xConflict,
|
||||
static_cast<void*>(&context));
|
||||
if (r == SQLITE_OK) {
|
||||
|
||||
Reference in new issue
Block a user