Slight optimization for scm_equal_p
[bpt/guile.git] / libguile / eq.c
index 99b3488..11dce99 100644 (file)
@@ -332,6 +332,14 @@ scm_equal_p (SCM x, SCM y)
   switch (SCM_TYP7 (x))
     {
     default:
+      /* Check equality between structs of equal type (see cell-type test above). */
+      if (SCM_STRUCTP (x))
+       {
+         if (SCM_INSTANCEP (x))
+           goto generic_equal;
+         else
+           return scm_i_struct_equalp (x, y);
+       }
       break;
     case scm_tc7_number:
       switch SCM_TYP16 (x)
@@ -349,14 +357,6 @@ scm_equal_p (SCM x, SCM y)
     case scm_tc7_wvect:
       return scm_i_vector_equal_p (x, y);
     }
-  /* Check equality between structs of equal type (see cell-type test above). */
-  if (SCM_STRUCTP (x))
-    {
-      if (SCM_INSTANCEP (x))
-        goto generic_equal;
-      else
-        return scm_i_struct_equalp (x, y);
-    }
 
   /* Otherwise just return false. Dispatching to the generic is the wrong thing
      here, as we can hit this case for any two objects of the same type that we