summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Llorens <daniel.llorens@bluewin.ch>2013-04-26 13:02:38 +0200
committerAndy Wingo <wingo@pobox.com>2014-01-27 21:48:03 +0100
commit86263a20cd3f7ec1ade740c19ac47767e083d058 (patch)
tree267696d5746a59eaf7489ad819a7bbcf59c5d3d0
parentce6fce6af3c405b6725664bf712dc5a0ec926a3c (diff)
downloadguile-86263a20cd3f7ec1ade740c19ac47767e083d058.tar.gz
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.
-rw-r--r--libguile/array-map.c10
1 files 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;
}