This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Remove pointer-set.c:pointer_set_contains ()


This function is unused.  Okay to remove it?

2004-11-18  Ben Elliston  <bje@au.ibm.com>

	* pointer-set.h (pointer_set_contains): Remove.
	* pointer-set.c (pointer_set_contains): Likewise.

Index: pointer-set.h
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/pointer-set.h,v
retrieving revision 2.1
diff -u -p -r2.1 pointer-set.h
--- pointer-set.h	14 Oct 2004 23:15:20 -0000	2.1
+++ pointer-set.h	17 Nov 2004 23:25:12 -0000
@@ -26,7 +26,6 @@ struct pointer_set_t;
 struct pointer_set_t *pointer_set_create (void);
 void pointer_set_destroy (struct pointer_set_t *pset);
 
-int pointer_set_contains (struct pointer_set_t *pset, void *p);
 int pointer_set_insert (struct pointer_set_t *pset, void *p);
 
 #endif  /* POINTER_SET_H  */
Index: pointer-set.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/pointer-set.c,v
retrieving revision 2.5
diff -u -p -r2.5 pointer-set.c
--- pointer-set.c	22 Oct 2004 17:05:05 -0000	2.5
+++ pointer-set.c	17 Nov 2004 23:25:12 -0000
@@ -90,31 +90,6 @@ void pointer_set_destroy (struct pointer
   XDELETE (pset);
 }
 
-/* Returns nonzero if PSET contains P.  P must be nonnull.
-
-   Collisions are resolved by linear probing.  More complicated
-   collision management schemes are only useful when the load factor
-   significantly exceeds 0.5, and we never let that happen.  */
-int
-pointer_set_contains (struct pointer_set_t *pset, void *p)
-{
-  size_t n = hash1 (p, pset->n_slots, pset->log_slots);
-
-  while (true)
-    {
-      if (pset->slots[n] == p)
-	return 1;
-      else if (pset->slots[n] == 0)
-	return 0;
-      else
-	{
-	  ++n;
-	  if (n == pset->n_slots)
-	    n = 0;
-	}
-    }
-}
-
 /* Subroutine of pointer_set_insert.  Inserts P into an empty
    element of SLOTS, an array of length N_SLOTS.  Returns nonzero
    if P was already present in N_SLOTS.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]