[m-rev.] for post-commit review: special case to_string via a switch

Julien Fischer jfischer at opturion.com
Wed Jan 1 20:08:48 AEDT 2025


On Wed, 1 Jan 2025 at 18:59, Zoltan Somogyi <zoltan.somogyi at runbox.com> wrote:
>
> Replace an if-then-else chain with two switches.
>
> library/string.to_string.m:
>     Replace a long series of dynamic cast tests with a switch on the
>     id of the type of the value we are trying to convert to a string.
>     Besides being clearer, the new code is also faster. To help the latter
>     along, also change the code of det_dynamic_casts to avoid a memory
>     allocation.
>
>     In the process, fix an old oversight: treat int64 and uint64 values
>     the same way as we treat other sized integers.
>
> tests/hard_coded/uint64_switch_test.exp:
>     Expect that updated treatment.

That looks fine.

Julien.


More information about the reviews mailing list