diff options
author | dkf <dkf@noemail.net> | 2009-01-09 11:21:45 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2009-01-09 11:21:45 (GMT) |
commit | fa315dba1db389b3ab991fb90927359a8580ca06 (patch) | |
tree | 4aa51d7f8297e2b7b5f11c316610f06e345c362d /generic/tclHash.c | |
parent | d077fb5a5f2ad30c6467ad7cf4c40a2559cf5f64 (diff) | |
download | tcl-fa315dba1db389b3ab991fb90927359a8580ca06.zip tcl-fa315dba1db389b3ab991fb90927359a8580ca06.tar.gz tcl-fa315dba1db389b3ab991fb90927359a8580ca06.tar.bz2 |
Style fixes (unfouling whitespace, sorting comments, removing useless casts, etc.)
FossilOrigin-Name: cd3c38f00ada216d7bc93560d3d70012c2918343
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r-- | generic/tclHash.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c index 89fbb6f..218d8e1 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.37 2008/11/17 22:15:34 nijtmans Exp $ + * RCS: @(#) $Id: tclHash.c,v 1.38 2009/01/09 11:21:45 dkf Exp $ */ #include "tclInt.h" @@ -283,13 +283,13 @@ Tcl_CreateHashEntry( if (typePtr->hashKeyProc) { hash = typePtr->hashKeyProc(tablePtr, (void *) key); if (typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) { - index = RANDOM_INDEX (tablePtr, hash); + index = RANDOM_INDEX(tablePtr, hash); } else { index = hash & tablePtr->mask; } } else { hash = PTR2UINT(key); - index = RANDOM_INDEX (tablePtr, hash); + index = RANDOM_INDEX(tablePtr, hash); } /* @@ -298,6 +298,7 @@ Tcl_CreateHashEntry( if (typePtr->compareKeysProc) { Tcl_CompareHashKeysProc *compareKeysProc = typePtr->compareKeysProc; + for (hPtr = tablePtr->buckets[index]; hPtr != NULL; hPtr = hPtr->nextPtr) { #if TCL_HASH_KEY_STORE_HASH @@ -441,7 +442,7 @@ Tcl_DeleteHashEntry( tablePtr->numEntries--; if (typePtr->freeEntryProc) { - typePtr->freeEntryProc (entryPtr); + typePtr->freeEntryProc(entryPtr); } else { ckfree((char *) entryPtr); } @@ -492,7 +493,7 @@ Tcl_DeleteHashTable( while (hPtr != NULL) { nextPtr = hPtr->nextPtr; if (typePtr->freeEntryProc) { - typePtr->freeEntryProc (hPtr); + typePtr->freeEntryProc(hPtr); } else { ckfree((char *) hPtr); } @@ -1041,7 +1042,7 @@ RebuildTable( #if TCL_HASH_KEY_STORE_HASH if (typePtr->hashKeyProc == NULL || typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) { - index = RANDOM_INDEX (tablePtr, hPtr->hash); + index = RANDOM_INDEX(tablePtr, hPtr->hash); } else { index = PTR2UINT(hPtr->hash) & tablePtr->mask; } @@ -1055,12 +1056,12 @@ RebuildTable( hash = typePtr->hashKeyProc(tablePtr, key); if (typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) { - index = RANDOM_INDEX (tablePtr, hash); + index = RANDOM_INDEX(tablePtr, hash); } else { index = hash & tablePtr->mask; } } else { - index = RANDOM_INDEX (tablePtr, key); + index = RANDOM_INDEX(tablePtr, key); } hPtr->bucketPtr = &(tablePtr->buckets[index]); |