• Paul Eggert's avatar
    Tune base64 decoding · 5abaea33
    Paul Eggert authored
    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)
    (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.
fns.c 157 KB