From 86263a20cd3f7ec1ade740c19ac47767e083d058 Mon Sep 17 00:00:00 2001 From: Daniel Llorens Date: Fri, 26 Apr 2013 13:02:38 +0200 Subject: Don't use ASET in scm_array_index_map_x * libguile/array-map.c: (scm_array_index_map_x): replace ASET by direct use of handle->impl. --- libguile/array-map.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libguile/array-map.c b/libguile/array-map.c index 26ad95e44..b18824384 100644 --- a/libguile/array-map.c +++ b/libguile/array-map.c @@ -715,6 +715,7 @@ SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0, "@end lisp") #define FUNC_NAME s_scm_array_index_map_x { + scm_t_array_handle h; SCM_VALIDATE_PROC (2, proc); if (!scm_is_array (ra)) @@ -722,15 +723,12 @@ SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0, /* This also covers the not-SCM_I_ARRAYP case */ else if (1 == scm_c_array_rank(ra)) { - scm_t_array_handle h; ssize_t i, inc; size_t p; - SCM v; scm_array_get_handle (ra, &h); - v = h.array; inc = h.dims[0].inc; for (i = h.dims[0].lbnd, p = h.base; i <= h.dims[0].ubnd; ++i, p += inc) - h.impl->vset (v, p, scm_call_1 (proc, scm_from_ssize_t (i))); + h.impl->vset (h.array, p, scm_call_1 (proc, scm_from_ssize_t (i))); scm_array_handle_release (&h); } else @@ -751,6 +749,7 @@ SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0, return SCM_UNSPECIFIED; } + scm_array_get_handle (ra, &h); k = kmax; do { @@ -769,7 +768,7 @@ SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0, for (; vi[kmax] <= SCM_I_ARRAY_DIMS (ra)[kmax].ubnd; *q = scm_from_ssize_t (++vi[kmax])) { - ASET (SCM_I_ARRAY_V (ra), i, scm_apply_0 (proc, args)); + h.impl->vset (h.array, i, scm_apply_0 (proc, args)); i += SCM_I_ARRAY_DIMS (ra)[kmax].inc; } k--; @@ -786,6 +785,7 @@ SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0, } } while (k >= 0); + scm_array_handle_release (&h); } return SCM_UNSPECIFIED; } -- cgit v1.2.3