diff options
author | dkf <dkf@noemail.net> | 2007-07-02 20:30:43 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2007-07-02 20:30:43 (GMT) |
commit | 4f220d653678ef5bf3e984d7745b994e74a07c2d (patch) | |
tree | 5f2b0e7e1e3b5b9976a0897890dc730f9110ae48 /generic/tclHash.c | |
parent | d0bd5a5c89712418b66e27e3459662c1c3efd9df (diff) | |
download | tcl-4f220d653678ef5bf3e984d7745b994e74a07c2d.zip tcl-4f220d653678ef5bf3e984d7745b994e74a07c2d.tar.gz tcl-4f220d653678ef5bf3e984d7745b994e74a07c2d.tar.bz2 |
Simplify string hashing a little. [FRQ 951168]
FossilOrigin-Name: bf5e28ec4a3340b2999af743e046a5f568aa9cb8
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r-- | generic/tclHash.c | 16 |
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 { |