git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hash: Remove useless init_hash()
@ 2010-07-27  5:36 Stephen Boyd
  2010-07-27 10:30 ` Jakub Narebski
  2010-07-27 15:55 ` Linus Torvalds
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Boyd @ 2010-07-27  5:36 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

init_hash() is essentially a memset() so just use that.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
 Documentation/technical/api-hash.txt |    4 ----
 diffcore-rename.c                    |    2 +-
 hash.h                               |    7 -------
 3 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/Documentation/technical/api-hash.txt b/Documentation/technical/api-hash.txt
index e5061e0..7cf64ec 100644
--- a/Documentation/technical/api-hash.txt
+++ b/Documentation/technical/api-hash.txt
@@ -23,10 +23,6 @@ Data Structures
 Functions
 ---------
 
-`init_hash`::
-
-	Initialize the hash table.
-
 `free_hash`::
 
 	Release memory associated with the hash table.
diff --git a/diffcore-rename.c b/diffcore-rename.c
index df41be5..b355520 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -382,7 +382,7 @@ static int find_exact_renames(void)
 	int i;
 	struct hash_table file_table;
 
-	init_hash(&file_table);
+	memset(&file_table, 0, sizeof(file_table));
 	for (i = 0; i < rename_src_nr; i++)
 		insert_file_table(&file_table, -1, i, rename_src[i].one);
 
diff --git a/hash.h b/hash.h
index 69e33a4..418be24 100644
--- a/hash.h
+++ b/hash.h
@@ -33,11 +33,4 @@ extern void **insert_hash(unsigned int hash, void *ptr, struct hash_table *table
 extern int for_each_hash(const struct hash_table *table, int (*fn)(void *));
 extern void free_hash(struct hash_table *table);
 
-static inline void init_hash(struct hash_table *table)
-{
-	table->size = 0;
-	table->nr = 0;
-	table->array = NULL;
-}
-
 #endif
-- 
1.7.2.19.g9a302

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-07-28  7:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27  5:36 [PATCH] hash: Remove useless init_hash() Stephen Boyd
2010-07-27 10:30 ` Jakub Narebski
2010-07-27 10:36   ` Ævar Arnfjörð Bjarmason
2010-07-27 19:49     ` Jeff King
2010-07-27 19:58       ` Ævar Arnfjörð Bjarmason
2010-07-28  7:33         ` Stephen Boyd
2010-07-27 15:55 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).