1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Inline scm_i_array_implementation_for_obj in scm_i_array

* libguile/generalized-arrays.c (scm_is_array, scm_is_typed_array): In
  preparation for removing the registry of array implementations, remove
  a couple uss of scm_i_array_implementation_for_obj.
This commit is contained in:
Andy Wingo 2014-02-08 21:42:53 +01:00
parent 7070f12b9d
commit 2b5625ad0c

View file

@ -42,7 +42,20 @@ SCM_INTERNAL SCM scm_i_array_set_x (SCM v, SCM obj,
int int
scm_is_array (SCM obj) scm_is_array (SCM obj)
{ {
return scm_i_array_implementation_for_obj (obj) ? 1 : 0; if (!SCM_HEAP_OBJECT_P (obj))
return 0;
switch (SCM_TYP7 (obj))
{
case scm_tc7_string:
case scm_tc7_vector:
case scm_tc7_bitvector:
case scm_tc7_bytevector:
case scm_tc7_array:
return 1;
default:
return 0;
}
} }
SCM_DEFINE (scm_array_p_2, "array?", 1, 0, 0, SCM_DEFINE (scm_array_p_2, "array?", 1, 0, 0,
@ -69,7 +82,7 @@ int
scm_is_typed_array (SCM obj, SCM type) scm_is_typed_array (SCM obj, SCM type)
{ {
int ret = 0; int ret = 0;
if (scm_i_array_implementation_for_obj (obj)) if (scm_is_array (obj))
{ {
scm_t_array_handle h; scm_t_array_handle h;