Commit c0afbd68 authored by vasil's avatar vasil

branches/zip: Use hash_table_clear() to initialize the array instead of

for()-loop.

Suggested by:	Sunny
Approved by:	Marko
parent ab2e2d0a
...@@ -103,12 +103,7 @@ hash_create( ...@@ -103,12 +103,7 @@ hash_create(
table->magic_n = HASH_TABLE_MAGIC_N; table->magic_n = HASH_TABLE_MAGIC_N;
/* Initialize the cell array */ /* Initialize the cell array */
hash_table_clear(table);
for (i = 0; i < prime; i++) {
cell = hash_get_nth_cell(table, i);
cell->node = NULL;
}
return(table); return(table);
} }
......
...@@ -180,7 +180,7 @@ hash_get_nth_cell( ...@@ -180,7 +180,7 @@ hash_get_nth_cell(
ulint n); /* in: cell index */ ulint n); /* in: cell index */
/***************************************************************** /*****************************************************************
Clears a hash table so that all the cells become empty again. */ Clears a hash table so that all the cells become empty. */
UNIV_INLINE UNIV_INLINE
void void
hash_table_clear( hash_table_clear(
......
...@@ -24,7 +24,7 @@ hash_get_nth_cell( ...@@ -24,7 +24,7 @@ hash_get_nth_cell(
} }
/***************************************************************** /*****************************************************************
Clears a hash table so that all the cells become empty again. */ Clears a hash table so that all the cells become empty. */
UNIV_INLINE UNIV_INLINE
void void
hash_table_clear( hash_table_clear(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment