From ba595da027e8e52392577f1d98fc30cb6895e723 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Tue, 8 Aug 2017 18:56:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DGIE=E5=9C=A8=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=B6=E4=B8=A2=E5=A4=B1tag=E7=9A=84bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/gram_index_engine.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/entry/gram_index_engine.c b/src/entry/gram_index_engine.c index ef4475d..cd0a086 100644 --- a/src/entry/gram_index_engine.c +++ b/src/entry/gram_index_engine.c @@ -714,23 +714,16 @@ void copy_indextable_item_iterate(const uchar * key, uint size, void * data, voi } MESA_htable_add(htable_copied_para->runtime_table, key, size, (const void *)index_data_copy); } - +//TODO: Using the orginal value instead of make a duplication to be faster. void copy_idtable_item_iterate(const uchar * key, uint size, void * data, void * user) { struct id_table_data * id_data = (struct id_table_data *)data; struct htable_handle * htable_para = (struct htable_handle *)user; struct id_table_data * id_data_copy = (struct id_table_data *)calloc(1, sizeof(struct id_table_data)); - id_data_copy->blocksize = id_data->blocksize; - id_data_copy->cfds_lvl = id_data->cfds_lvl; - id_data_copy->gram_cnt = id_data->gram_cnt; - id_data_copy->id = id_data->id; - id_data_copy->sfh_length = id_data->sfh_length; + memcpy(id_data_copy,id_data,sizeof(struct id_table_data)); id_data_copy->sfh = (char *)calloc(id_data_copy->sfh_length,sizeof(char)); memcpy(id_data_copy->sfh,id_data->sfh,id_data_copy->sfh_length); - /*int tag_len = strlen(id_data->tag); - id_data_copy->tag = (char *)calloc(tag_len+1,sizeof(char)); - memcpy(id_data_copy->tag,id_data->tag,tag_len);*/ MESA_htable_add(htable_para->runtime_table, (const uchar *)(&(id_data_copy->id)), sizeof(id_data_copy->id), (const void *)id_data_copy); }