diff options
| author | Bruce Momjian <bruce@momjian.us> | 1998-03-30 17:28:21 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 1998-03-30 17:28:21 +0000 |
| commit | 57b5966405fb6e237676acef55973c064ac65a2a (patch) | |
| tree | d2397c1d3308e56cd33c5f2f607e26129106ed4a /src/backend/access/hash/hashfunc.c | |
| parent | 31c36102cab914f6664ee2db20c7732aeb51a02b (diff) | |
| download | postgresql-57b5966405fb6e237676acef55973c064ac65a2a.tar.gz | |
The following uuencoded, gzip'd file will ...
1. Remove the char2, char4, char8 and char16 types from postgresql
2. Change references of char16 to name in the regression tests.
3. Rename the char16.sql regression test to name.sql. 4. Modify
the regression test scripts and outputs to match up.
Might require new regression.{SYSTEM} files...
Darren King
Diffstat (limited to 'src/backend/access/hash/hashfunc.c')
| -rw-r--r-- | src/backend/access/hash/hashfunc.c | 75 |
1 files changed, 4 insertions, 71 deletions
diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c index 8da88101dd..37b7722b8c 100644 --- a/src/backend/access/hash/hashfunc.c +++ b/src/backend/access/hash/hashfunc.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.6 1997/09/08 21:40:47 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.7 1998/03/30 17:22:08 momjian Exp $ * * NOTES * These functions are stored in pg_amproc. For each operator class @@ -133,6 +133,8 @@ hashoid(Oid key) return ((uint32) ~key); } +#define PRIME1 37 +#define PRIME2 1048583 uint32 hashchar(char key) @@ -140,12 +142,8 @@ hashchar(char key) int len; uint32 h; - len = sizeof(char); - -#define PRIME1 37 -#define PRIME2 1048583 - h = 0; + len = sizeof(char); /* Convert char to integer */ h = h * PRIME1 ^ (key - ' '); h %= PRIME2; @@ -153,55 +151,6 @@ hashchar(char key) return (h); } -uint32 -hashchar2(uint16 intkey) -{ - uint32 h; - int len; - char *key = (char *) &intkey; - - h = 0; - len = sizeof(uint16); - /* Convert string to integer */ - while (len--) - h = h * PRIME1 ^ (*key++ - ' '); - h %= PRIME2; - - return (h); -} - -uint32 -hashchar4(uint32 intkey) -{ - uint32 h; - int len; - char *key = (char *) &intkey; - - h = 0; - len = sizeof(uint32); - /* Convert string to integer */ - while (len--) - h = h * PRIME1 ^ (*key++ - ' '); - h %= PRIME2; - - return (h); -} - -uint32 -hashchar8(char *key) -{ - uint32 h; - int len; - - h = 0; - len = sizeof(char8); - /* Convert string to integer */ - while (len--) - h = h * PRIME1 ^ (*key++ - ' '); - h %= PRIME2; - - return (h); -} uint32 hashname(NameData *n) @@ -223,22 +172,6 @@ hashname(NameData *n) } -uint32 -hashchar16(char *key) -{ - uint32 h; - int len; - - h = 0; - len = sizeof(char16); - /* Convert string to integer */ - while (len--) - h = h * PRIME1 ^ (*key++ - ' '); - h %= PRIME2; - - return (h); -} - /* * (Comment from the original db3 hashing code: ) |
