From: Eric Bollengier Date: Sun, 23 Jan 2011 16:01:33 +0000 (+0100) Subject: Tweak accurate code to avoid useless memcpy() X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=96826d319df2d15b608ea82d5f0baa41434131f6;p=bacula%2Fbacula Tweak accurate code to avoid useless memcpy() --- 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);