diff --git a/src/database.js.c b/src/database.js.c index 6742aa7c..1c67bb5a 100644 --- a/src/database.js.c +++ b/src/database.js.c @@ -390,8 +390,6 @@ static JSValue _database_remove(JSContext* context, JSValueConst this_val, int a typedef struct _database_get_all_t { const char* id; - const char* key; - size_t key_length; char** out_values; size_t* out_lengths; int out_values_length; @@ -455,17 +453,11 @@ static JSValue _database_get_all(JSContext* context, JSValueConst this_val, int { tf_ssb_t* ssb = tf_task_get_ssb(database->task); - size_t length; - const char* key = JS_ToCStringLen(context, &length, argv[0]); - database_get_all_t* work = tf_malloc(sizeof(database_get_all_t) + strlen(database->id) + 1 + length + 1); + database_get_all_t* work = tf_malloc(sizeof(database_get_all_t) + strlen(database->id) + 1); *work = (database_get_all_t) { .id = (const char*)(work + 1), - .key = (const char*)(work + 1) + strlen(database->id) + 1, - .key_length = length, }; memcpy((char*)work->id, database->id, strlen(database->id) + 1); - memcpy((char*)work->key, key, length + 1); - JS_FreeCString(context, key); tf_ssb_run_work(ssb, _database_get_all_work, _database_get_all_after_work, work); result = JS_NewPromiseCapability(context, work->promise);