mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[smjs] minor optimisation: one strlen less
This commit is contained in:
parent
21cf493377
commit
f72f2ae60a
@ -113,12 +113,9 @@ jsval_to_Latin1(JSContext *ctx, JS::HandleValue hvp, size_t *length)
|
||||
/* Memory must be freed in caller */
|
||||
JSString *st = JS::ToString(ctx, hvp);
|
||||
JS::UniqueChars chars = JS_EncodeStringToLatin1(ctx, st);
|
||||
*length = JS_GetStringLength(st);
|
||||
|
||||
if (length) {
|
||||
*length = JS_GetStringLength(st);
|
||||
}
|
||||
|
||||
return null_or_stracpy(chars.get());
|
||||
return memacpy(chars.get(), *length);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
Loading…
Reference in New Issue
Block a user