core: Prefer JS_AtomToCString() over JS_AtomToString() + JS_ToCString().
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
2025-06-11 12:46:52 -04:00
parent 18908b6b56
commit 2f0a2ac6b0
4 changed files with 5 additions and 15 deletions

View File

@ -142,8 +142,7 @@ void tf_ssb_export(tf_ssb_t* ssb, const char* key)
JSPropertyDescriptor desc;
if (JS_GetOwnProperty(context, &desc, files, ptab[i].atom) == 1)
{
JSValue key = JS_AtomToString(context, ptab[i].atom);
const char* file_name = JS_ToCString(context, key);
const char* file_name = JS_AtomToCString(context, ptab[i].atom);
const char* blob_id = JS_ToCString(context, desc.value);
uint8_t* file_blob = NULL;
@ -156,7 +155,6 @@ void tf_ssb_export(tf_ssb_t* ssb, const char* key)
}
JS_FreeCString(context, file_name);
JS_FreeValue(context, key);
JS_FreeCString(context, blob_id);
JS_FreeValue(context, desc.value);
JS_FreeValue(context, desc.setter);