GNU bug report logs - #46761
28.0.50; Speed up json.el encoding

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Thu, 25 Feb 2021 01:35:01 UTC

Severity: wishlist

Tags: fixed, patch

Found in version 28.0.50

Fixed in version 28.1

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: 46761 <at> debbugs.gnu.org
Subject: bug#46761: 28.0.50; Speed up json.el encoding
Date: Thu, 25 Feb 2021 19:36:14 +0000
"Basil L. Contovounesios" <contovob <at> 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




This bug report was last modified 4 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.