• Paul Eggert's avatar
    Improve performance by avoiding strtoumax · 178d0cb5
    Paul Eggert authored
    This made (string-to-number "10") 20% faster on my old desktop,
    an AMD Phenom II X4 910e running Fedora 25 x86-64.
    * admin/merge-gnulib (GNULIB_MODULES): Remove strtoumax.
    * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
    * lib/strtoul.c, lib/strtoull.c, lib/strtoumax.c, m4/strtoull.m4:
    * m4/strtoumax.m4: Remove.
    * src/editfns.c (str2num): New function.
    (styled_format): Use it instead of strtoumax.  Use ptrdiff_t
    instead of uintmax_t.  Check for integer overflow.
    * src/lread.c (LEAD_INT, DOT_CHAR, TRAIL_INT, E_EXP):
    Move to private scope and make them enums.
    (string_to_number): Compute integer value directly during
    first pass instead of revisiting it with strtoumax later.
    178d0cb5
gnulib-comp.m4 30.3 KB