all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master 49e243c0c85: Avoid resizing mutation in subst-char-in-string, take two
@ 2024-05-13 17:53 Eli Zaretskii
  2024-05-13 19:20 ` Mattias Engdegård
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2024-05-13 17:53 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: emacs-devel

> +  (if (and (not inplace)
> +           (if (multibyte-string-p string)
> +               (> (max fromchar tochar) 127)
> +             (> tochar 255)))

Is the above condition correct?  My reading of it is that if INPLACE
is non-nil, we use aset (which will resize a string) even if TOCHAR
needs more bytes than FROMCHAR.  Which seems to be in contradiction
with the goal of the change, as advertised by the log message: "avoid
resizing mutation".  Did I miss something?

Btw, why, in the case of a multibyte STRING, does the code look at the
codepoints of FROMCHAR and TOCHAR and not at the number of bytes they
take in the internal Emacs representation of the characters?



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-05-15 20:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-13 17:53 master 49e243c0c85: Avoid resizing mutation in subst-char-in-string, take two Eli Zaretskii
2024-05-13 19:20 ` Mattias Engdegård
2024-05-14  6:06   ` Eli Zaretskii
2024-05-14 10:44     ` Mattias Engdegård
2024-05-14 11:35       ` Eli Zaretskii
2024-05-15 12:29         ` Mattias Engdegård
2024-05-15 12:40           ` Eli Zaretskii
2024-05-15 17:29             ` Mattias Engdegård
2024-05-15 18:15               ` Eli Zaretskii
2024-05-15 20:19                 ` Mattias Engdegård

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.