unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: 46761@debbugs.gnu.org
Subject: bug#46761: 28.0.50; Speed up json.el encoding
Date: Thu, 25 Feb 2021 19:36:14 +0000	[thread overview]
Message-ID: <87a6rsgcsx.fsf@tcd.ie> (raw)
In-Reply-To: <87ft1kgg9r.fsf@tcd.ie> (Basil L. Contovounesios's message of "Thu, 25 Feb 2021 18:21:20 +0000")

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> @@ -458,9 +460,9 @@ json-read-string
>  (defun json--print-string (string &optional from)
>    "Insert a JSON representation of STRING at point.
>  FROM is the index of STRING to start from and defaults to 0."
> -  (goto-char (prog1 (1+ (point))
> -               ;; Strip `read-only' property (bug#43549).
> -               (insert ?\" (substring-no-properties string from))))
> +  (goto-char (prog1 (1+ (point)) (insert ?\" string)))
> +  (set-text-properties (point) (point-max) ())
> +  (and from (delete-char from))

AKA:

  (insert ?\")
  (goto-char (prog1 (point) (princ string)))
  (and from (delete-char from))

-- 
Basil





  reply	other threads:[~2021-02-25 19:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  1:33 bug#46761: 28.0.50; Speed up json.el encoding Basil L. Contovounesios
2021-02-25 18:21 ` Basil L. Contovounesios
2021-02-25 19:36   ` Basil L. Contovounesios [this message]
2021-03-06 18:37     ` Basil L. Contovounesios
2021-02-27 18:51 ` Dmitry Gutov
2021-02-27 19:30   ` Basil L. Contovounesios
2021-02-27 20:01     ` Dmitry Gutov
2021-02-27 21:09       ` Basil L. Contovounesios
2021-02-27 21:10         ` Dmitry Gutov
2021-02-27 21:16   ` Basil L. Contovounesios
2021-02-27 21:21     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a6rsgcsx.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=46761@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).