emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Minor optimization in json.c


From: Eli Zaretskii
Subject: Re: Minor optimization in json.c
Date: Sun, 23 Sep 2018 12:06:38 +0300

> Date: Sat, 22 Sep 2018 17:10:03 +0300
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden
> 
> Currently, json.c has this FIXME:
> 
>   /* FIXME: This should be possible without creating an intermediate
>      string object.  */
>   Lisp_Object string
>     = json_make_string (buffer_and_size->buffer, buffer_and_size->size);
>   insert1 (string);
> 
> IIUC the issue, the change below should fix this.  All the tests in
> json-tests.el pass after the change, but maybe you had failures in
> other scenarios?  If not, I think we should make this change.

Actually, I think an even better idea is to do this like
insert-file-contents does: insert the raw string into the gap, then
decode it in one go with decode_coding_gap.  I will publish a proposed
patch along these lines soon.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]