[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/01: Speed up number->string
From: |
Andy Wingo |
Subject: |
[Guile-commits] 01/01: Speed up number->string |
Date: |
Fri, 17 Feb 2017 06:00:48 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit bfa6c401ceb418f63ba30e12ac73b34b0835ac88
Author: Andy Wingo <address@hidden>
Date: Fri Feb 17 11:58:22 2017 +0100
Speed up number->string
* libguile/numbers.c (scm_number_to_string): Use scm_from_latin1_string
where appropriate. Avoids mucking about with iconv.
---
libguile/numbers.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libguile/numbers.c b/libguile/numbers.c
index bc930af..07170d9 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);