*** ./src/backend/access/hash/hashfunc.c.orig	Wed Feb 13 21:09:37 2002
--- ./src/backend/access/hash/hashfunc.c	Thu Feb 14 00:39:42 2002
***************
*** 95,101 ****
  {
  	char	   *key = NameStr(*PG_GETARG_NAME(0));
  
! 	return hash_any((char *) key, NAMEDATALEN);
  }
  
  /*
--- 95,101 ----
  {
  	char	   *key = NameStr(*PG_GETARG_NAME(0));
  
! 	return hash_any(key, strlen(key));
  }
  
  /*
***************
*** 125,131 ****
   *
   * (Comment from the original db3 hashing code: )
   *
!  * "This is INCREDIBLY ugly, but fast.  We break the string up into 8 byte
   * units.  On the first time through the loop we get the 'leftover bytes'
   * (strlen % 8).  On every later iteration, we perform 8 HASHC's so we handle
   * all 8 bytes.  Essentially, this saves us 7 cmp & branch instructions.  If
--- 125,131 ----
   *
   * (Comment from the original db3 hashing code: )
   *
!  * This is INCREDIBLY ugly, but fast.  We break the string up into 8 byte
   * units.  On the first time through the loop we get the 'leftover bytes'
   * (strlen % 8).  On every later iteration, we perform 8 HASHC's so we handle
   * all 8 bytes.  Essentially, this saves us 7 cmp & branch instructions.  If
***************
*** 134,140 ****
   * "OZ's original sdbm hash"
   */
  Datum
! hash_any(char *keydata, int keylen)
  {
  	uint32		n;
  	int			loop;
--- 134,140 ----
   * "OZ's original sdbm hash"
   */
  Datum
! hash_any(const char *keydata, int keylen)
  {
  	uint32		n;
  	int			loop;
*** ./src/backend/utils/cache/catcache.c.orig	Thu Feb 14 12:51:00 2002
--- ./src/backend/utils/cache/catcache.c	Thu Feb 14 12:53:05 2002
***************
*** 93,99 ****
  static Index CatalogCacheComputeTupleHashIndex(CatCache *cache,
  								  HeapTuple tuple);
  static void CatalogCacheInitializeCache(CatCache *cache);
- static Datum cc_hashname(PG_FUNCTION_ARGS);
  
  
  /*
--- 93,98 ----
***************
*** 109,115 ****
  		case CHAROID:
  			return hashchar;
  		case NAMEOID:
! 			return cc_hashname;
  		case INT2OID:
  			return hashint2;
  		case INT2VECTOROID:
--- 108,114 ----
  		case CHAROID:
  			return hashchar;
  		case NAMEOID:
! 			return hashname;
  		case INT2OID:
  			return hashint2;
  		case INT2VECTOROID:
***************
*** 129,151 ****
  			return (PGFunction) NULL;
  	}
  }
- 
- static Datum
- cc_hashname(PG_FUNCTION_ARGS)
- {
- 	/*
- 	 * We need our own variant of hashname because we want to accept
- 	 * null-terminated C strings as search values for name fields. So, we
- 	 * have to make sure the data is correctly padded before we compute
- 	 * the hash value.
- 	 */
- 	NameData	my_n;
- 
- 	namestrcpy(&my_n, NameStr(*PG_GETARG_NAME(0)));
- 
- 	return DirectFunctionCall1(hashname, NameGetDatum(&my_n));
- }
- 
  
  /*
   * Standard routine for creating cache context if it doesn't exist yet
--- 128,133 ----
*** ./src/include/access/hash.h.orig	Wed Feb 13 22:43:06 2002
--- ./src/include/access/hash.h	Thu Feb 14 00:38:35 2002
***************
*** 265,271 ****
  extern Datum hashint2vector(PG_FUNCTION_ARGS);
  extern Datum hashname(PG_FUNCTION_ARGS);
  extern Datum hashvarlena(PG_FUNCTION_ARGS);
! extern Datum hash_any(char *keydata, int keylen);
  
  
  /* private routines */
--- 265,271 ----
  extern Datum hashint2vector(PG_FUNCTION_ARGS);
  extern Datum hashname(PG_FUNCTION_ARGS);
  extern Datum hashvarlena(PG_FUNCTION_ARGS);
! extern Datum hash_any(const char *keydata, int keylen);
  
  
  /* private routines */
