Commit 5abaea33 authored by Paul Eggert's avatar Paul Eggert Committed by Paul Eggert

Tune base64 decoding

This improves performance of base64-decode-region by about 7.5% on
my platform, and gets rid of some macros.
* src/fns.c (IS_ASCII, IS_BASE64, IS_BASE64_IGNORABLE)
(READ_QUADRUPLET_BYTE): Remove.
(base64_value_to_char, base64_char_to_value):
Now an array of two arrays.  All uses changed.
(base64url_value_to_char, base64url_char_to_value):
Remove.  All uses changed to the other array.
(base64_char_to_value): Entries are now of type signed char, not
short, since we can assume C99.  Use C99 initializers; this is
clearer and caters to the (theoretical) possibility of systems
that do not use ASCII or do not have 8-bit bytes.  Allow any index
in the range 0..UCHAR_MAX instead of limiting it to 0..127, so
that uses need not check for in-range indexes.  Also record
padding chars.  All uses changed.
(base64_decode_1): Always store number of chars in *NCHARS_RETURN,
for simplicity.  All callers changed.  Speed up the byte-fetching.
parent 1043cd30
Pipeline #1940 failed with stage
in 7 seconds