aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/jcf-io.c')
-rw-r--r--gcc/java/jcf-io.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c
index 91fe952..be251d4 100644
--- a/gcc/java/jcf-io.c
+++ b/gcc/java/jcf-io.c
@@ -272,33 +272,11 @@ find_classfile (char *filename, JCF *jcf, const char *dep_name)
return open_class (filename, jcf, fd, dep_name);
}
-
-/* Hash table helper. */
-
-struct charstar_hash : nofree_ptr_hash <const char>
-{
- static inline hashval_t hash (const char *candidate);
- static inline bool equal (const char *existing, const char *candidate);
-};
-
-inline hashval_t
-charstar_hash::hash (const char *candidate)
-{
- return htab_hash_string (candidate);
-}
-
-inline bool
-charstar_hash::equal (const char *existing, const char *candidate)
-{
- return strcmp (existing, candidate) == 0;
-}
-
-
/* A hash table keeping track of class names that were not found
during class lookup. (There is no need to cache the values
associated with names that were found; they are saved in
IDENTIFIER_CLASS_VALUE.) */
-static hash_table<charstar_hash> *memoized_class_lookups;
+static hash_table<nofree_string_hash> *memoized_class_lookups;
/* Returns a freshly malloc'd string with the fully qualified pathname
of the .class file for the class CLASSNAME. CLASSNAME must be
@@ -321,11 +299,11 @@ find_class (const char *classname, int classname_length, JCF *jcf)
/* Create the hash table, if it does not already exist. */
if (!memoized_class_lookups)
- memoized_class_lookups = new hash_table<charstar_hash> (37);
+ memoized_class_lookups = new hash_table<nofree_string_hash> (37);
/* Loop for this class in the hashtable. If it is present, we've
already looked for this class and failed to find it. */
- hash = charstar_hash::hash (classname);
+ hash = nofree_string_hash::hash (classname);
if (memoized_class_lookups->find_with_hash (classname, hash))
return NULL;