mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 12:20:26 +02:00
Don't bother with array handle in scm_c_array_rank
* libguile/generalized-arrays.c: (scm_c_array_rank): compute rank directly from object.
This commit is contained in:
parent
a70333d296
commit
3e5f10e8a2
1 changed files with 7 additions and 8 deletions
|
@ -94,13 +94,12 @@ SCM_DEFINE (scm_typed_array_p, "typed-array?", 2, 0, 0,
|
|||
size_t
|
||||
scm_c_array_rank (SCM array)
|
||||
{
|
||||
scm_t_array_handle handle;
|
||||
size_t res;
|
||||
|
||||
scm_array_get_handle (array, &handle);
|
||||
res = scm_array_handle_rank (&handle);
|
||||
scm_array_handle_release (&handle);
|
||||
return res;
|
||||
if (SCM_I_ARRAYP (array))
|
||||
return SCM_I_ARRAY_NDIM (array);
|
||||
else if (scm_i_array_implementation_for_obj (array))
|
||||
return 1;
|
||||
else
|
||||
scm_wrong_type_arg_msg (NULL, 0, array, "array");
|
||||
}
|
||||
|
||||
SCM_DEFINE (scm_array_rank, "array-rank", 1, 0, 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue