bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#56347: Optimize/simplify STRING_SET_MULTIBYTE


From: Stefan Monnier
Subject: bug#56347: Optimize/simplify STRING_SET_MULTIBYTE
Date: Sat, 02 Jul 2022 14:37:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> Yes.  In my book, STRING_SET_*IBYTE should basically not exist: a string
>> is created as unibyte or multibyte and never changes after that.
>
> That's require a much larger change, I think.  It is not enough just
> to add an assertion in one place, because that'd just cause
> maintenance headaches for no real gain.

`grep STRING_SET_MULTIBYTE` suggests it's not nearly as hard you think.

The only other use is in `aset`.

>> And indeed because we only have a single copy of the two possible empty
>> strings, they can't be changed between unibyte<->multibyte
> I can create an empty string without those singletons any time.

My experience is that it takes a fair bit of work to do so.


        Stefan






reply via email to

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