mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[js] minor optimisation. add_bytes_to_string, because length is known.
This commit is contained in:
parent
f72f2ae60a
commit
67670c28a0
@ -1043,7 +1043,7 @@ js_document_replace(JSContext *ctx, JSValueConst this_val, int argc, JSValueCons
|
|||||||
|
|
||||||
struct string f_data;
|
struct string f_data;
|
||||||
if (init_string(&f_data)) {
|
if (init_string(&f_data)) {
|
||||||
add_to_string(&f_data,f->data);
|
add_bytes_to_string(&f_data, f->data, f->length);
|
||||||
|
|
||||||
struct string nu_str;
|
struct string nu_str;
|
||||||
if (init_string(&nu_str)) {
|
if (init_string(&nu_str)) {
|
||||||
|
@ -1429,7 +1429,7 @@ document_replace(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
|||||||
|
|
||||||
struct string f_data;
|
struct string f_data;
|
||||||
if (init_string(&f_data)) {
|
if (init_string(&f_data)) {
|
||||||
add_to_string(&f_data,f->data);
|
add_bytes_to_string(&f_data, f->data, f->length);
|
||||||
|
|
||||||
struct string nu_str;
|
struct string nu_str;
|
||||||
if (init_string(&nu_str)) {
|
if (init_string(&nu_str)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user