From 2c18d5ca523377e9d665e969373b6923b5736bb5 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 23 Jan 2011 17:01:33 +0100 Subject: [PATCH] Tweak accurate code to avoid useless memcpy() --- bacula/src/filed/accurate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bacula/src/filed/accurate.c b/bacula/src/filed/accurate.c index ce30fd922c..9883bf24ef 100644 --- a/bacula/src/filed/accurate.c +++ b/bacula/src/filed/accurate.c @@ -204,14 +204,14 @@ static bool accurate_add_file(JCR *jcr, uint32_t len, int32_t delta) { bool ret = true; - CurFile elt; - elt.seen = 0; - CurFile *item; + /* we store CurFile, fname and ctime/mtime in the same chunk */ + /* TODO: see if len contains already the 3 \0 */ item = (CurFile *)jcr->file_list->hash_malloc(sizeof(CurFile)+len+3); - memcpy(item, &elt, sizeof(CurFile)); + item->seen = 0; + /* TODO: see if we can optimize this part with memcpy instead of strcpy */ item->fname = (char *)item+sizeof(CurFile); strcpy(item->fname, fname); -- 2.39.5