diff options
author | Andy Wingo <wingo@pobox.com> | 2017-02-17 11:58:22 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2017-02-17 11:58:22 +0100 |
commit | bfa6c401ceb418f63ba30e12ac73b34b0835ac88 (patch) | |
tree | 3adf2b7e014612648bb61dc537424f615c6c1475 /libguile | |
parent | 9ee21f3e97ae65b79a861d076e3ea8f73508bda8 (diff) |
Speed up number->string
* libguile/numbers.c (scm_number_to_string): Use scm_from_latin1_string
where appropriate. Avoids mucking about with iconv.
Diffstat (limited to 'libguile')
-rw-r--r-- | libguile/numbers.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libguile/numbers.c b/libguile/numbers.c index bc930af3b..07170d922 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -5623,7 +5623,7 @@ SCM_DEFINE (scm_number_to_string, "number->string", 1, 1, 0, { char num_buf [SCM_INTBUFLEN]; size_t length = scm_iint2str (SCM_I_INUM (n), base, num_buf); - return scm_from_locale_stringn (num_buf, length); + return scm_from_latin1_stringn (num_buf, length); } else if (SCM_BIGP (n)) { @@ -5640,13 +5640,13 @@ SCM_DEFINE (scm_number_to_string, "number->string", 1, 1, 0, else if (SCM_FRACTIONP (n)) { return scm_string_append (scm_list_3 (scm_number_to_string (SCM_FRACTION_NUMERATOR (n), radix), - scm_from_locale_string ("/"), + scm_from_latin1_string ("/"), scm_number_to_string (SCM_FRACTION_DENOMINATOR (n), radix))); } else if (SCM_INEXACTP (n)) { char num_buf [FLOBUFLEN]; - return scm_from_locale_stringn (num_buf, iflo2str (n, num_buf, base)); + return scm_from_latin1_stringn (num_buf, iflo2str (n, num_buf, base)); } else SCM_WRONG_TYPE_ARG (1, n); |