| 227 | } |
| 228 | |
| 229 | const char *msNextKeyFromHashTable( hashTableObj *table, const char *lastKey ) |
| 230 | { |
| 231 | int hash_index; |
| 232 | struct hashObj *link; |
| 233 | |
| 234 | if (!table) { |
| 235 | msSetError(MS_HASHERR, "No hash table", "msNextKeyFromHashTable"); |
| 236 | return NULL; |
| 237 | } |
| 238 | |
| 239 | if ( lastKey == NULL ) |
| 240 | return msFirstKeyFromHashTable( table ); |
| 241 | |
| 242 | hash_index = hash(lastKey); |
| 243 | for ( link = table->items[hash_index]; |
| 244 | link != NULL && strcasecmp(lastKey,link->key) != 0; |
| 245 | link = link->next ) {} |
| 246 | |
| 247 | if ( link != NULL && link->next != NULL ) |
| 248 | return link->next->key; |
| 249 | |
| 250 | while ( ++hash_index < MS_HASHSIZE ) { |
| 251 | if ( table->items[hash_index] != NULL ) |
| 252 | return table->items[hash_index]->key; |
| 253 | } |
| 254 | |
| 255 | return NULL; |
| 256 | } |
| 257 |
no test coverage detected