Changeset 1413
- Timestamp:
- Aug 6, 2004, 2:33:36 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sysUtils/psHash.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sysUtils/psHash.c
r1407 r1413 11 11 * @author George Gusciora, MHPCC 12 12 * 13 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-08-07 00: 06:06 $13 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-08-07 00:33:36 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 119 119 return; 120 120 } 121 // A bucket is actually a linked list of buckets. We recursively step122 // through that linked list, free each bucket.123 psFree(bucket->next);124 121 125 122 psFree(bucket->key); … … 183 180 184 181 // A bucket is composed of a linked list of buckets. 185 if (table->buckets[i] != NULL) { 186 psFree(table->buckets[i]); 182 while (table->buckets[i] != NULL) { 183 psHashBucket* bucket = table->buckets[i]; 184 table->buckets[i] = bucket->next; 185 psFree(bucket); 187 186 } 188 187 } … … 263 262 optr = ptr; 264 263 while (ptr != NULL) { 265 // D termine if this entry holds the correct key.264 // Determine if this entry holds the correct key. 266 265 if (strcmp(key, ptr->key) == 0) { 267 266 // The following lines of code are fairly standard ways … … 274 273 table->buckets[hash] = ptr->next; 275 274 } 276 277 275 psFree(ptr); 278 276
Note:
See TracChangeset
for help on using the changeset viewer.
