From 617cbacd07c6c199de1b7feb1b66bf7b48529a48 Mon Sep 17 00:00:00 2001
From: vasil <Unknown>
Date: Thu, 23 Aug 2007 07:01:24 +0000
Subject: [PATCH] branches/zip: Use hash_table_clear() to initialize the array
 instead of for()-loop.

Suggested by:	Sunny
Approved by:	Marko
---
 ha/hash0hash.c       | 7 +------
 include/hash0hash.h  | 2 +-
 include/hash0hash.ic | 2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/ha/hash0hash.c b/ha/hash0hash.c
index a9d1c01b7a9..9d1d019c9af 100644
--- a/ha/hash0hash.c
+++ b/ha/hash0hash.c
@@ -103,12 +103,7 @@ hash_create(
 	table->magic_n = HASH_TABLE_MAGIC_N;
 
 	/* Initialize the cell array */
-
-	for (i = 0; i < prime; i++) {
-
-		cell = hash_get_nth_cell(table, i);
-		cell->node = NULL;
-	}
+	hash_table_clear(table);
 
 	return(table);
 }
diff --git a/include/hash0hash.h b/include/hash0hash.h
index c944de3d9df..48524c80408 100644
--- a/include/hash0hash.h
+++ b/include/hash0hash.h
@@ -180,7 +180,7 @@ hash_get_nth_cell(
 	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
 void
 hash_table_clear(
diff --git a/include/hash0hash.ic b/include/hash0hash.ic
index 2bae9f04cb3..7fa71f29967 100644
--- a/include/hash0hash.ic
+++ b/include/hash0hash.ic
@@ -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
 void
 hash_table_clear(
-- 
2.30.9