summaryrefslogtreecommitdiffstats
path: root/generic/tclHash.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2007-07-02 20:30:44 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2007-07-02 20:30:44 (GMT)
commitb56947219139a3ea4cd1fa607c4fb4a2aea1b292 (patch)
tree5f2b0e7e1e3b5b9976a0897890dc730f9110ae48 /generic/tclHash.c
parent6815029e55cbb1f53e50d279923c2cf0218b42d2 (diff)
downloadtcl-b56947219139a3ea4cd1fa607c4fb4a2aea1b292.zip
tcl-b56947219139a3ea4cd1fa607c4fb4a2aea1b292.tar.gz
tcl-b56947219139a3ea4cd1fa607c4fb4a2aea1b292.tar.bz2
Simplify string hashing a little. [FRQ 951168]
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r--generic/tclHash.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c
index 8be7d1f..3bb863d 100644
--- a/generic/tclHash.c
+++ b/generic/tclHash.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclHash.c,v 1.29 2007/04/17 14:49:53 dkf Exp $
+ * RCS: @(#) $Id: tclHash.c,v 1.30 2007/07/02 20:30:50 dkf Exp $
*/
#include "tclInt.h"
@@ -925,19 +925,7 @@ CompareStringKeys(
register const char *p1 = (const char *) keyPtr;
register const char *p2 = (const char *) hPtr->key.string;
-#ifdef TCL_COMPARE_HASHES_WITH_STRCMP
return !strcmp(p1, p2);
-#else
- for (;; p1++, p2++) {
- if (*p1 != *p2) {
- break;
- }
- if (*p1 == '\0') {
- return 1;
- }
- }
- return 0;
-#endif /* TCL_COMPARE_HASHES_WITH_STRCMP */
}
/*
@@ -1139,7 +1127,7 @@ RebuildTable(
if (typePtr->hashKeyProc) {
unsigned int hash;
- hash = typePtr->hashKeyProc(tablePtr, (VOID *) key);
+ hash = typePtr->hashKeyProc(tablePtr, key);
if (typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
index = RANDOM_INDEX (tablePtr, hash);
} else {