Inline scm_i_array_implementation_for_obj in scm_i_array
authorAndy Wingo <wingo@pobox.com>
Sat, 8 Feb 2014 20:42:53 +0000 (21:42 +0100)
committerAndy Wingo <wingo@pobox.com>
Sat, 8 Feb 2014 20:46:06 +0000 (21:46 +0100)
* 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.

libguile/generalized-arrays.c

index 88c1cde..9a001eb 100644 (file)
@@ -42,7 +42,20 @@ SCM_INTERNAL SCM scm_i_array_set_x (SCM v, SCM obj,
 int
 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,
@@ -69,7 +82,7 @@ int
 scm_is_typed_array (SCM obj, SCM type)
 {
   int ret = 0;
-  if (scm_i_array_implementation_for_obj (obj))
+  if (scm_is_array (obj))
     {
       scm_t_array_handle h;