From b1d0e0e97ce747534a945a6fe0c3a15ccd8dbf00 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 6 Mar 2019 22:25:56 -0800 Subject: parse: Use a trie to hold currently open files --- eval.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index d4097ef..53eacf8 100644 --- a/eval.c +++ b/eval.c @@ -1142,10 +1142,8 @@ static bool eval_file_unique(struct eval_state *state, struct trie *seen) { return false; } - // Glue the device and inode numbers together as a unique ID - unsigned char id[sizeof(statbuf->dev) + sizeof(statbuf->ino)]; - memcpy(id, &statbuf->dev, sizeof(statbuf->dev)); - memcpy(id + sizeof(statbuf->dev), &statbuf->ino, sizeof(statbuf->ino)); + bfs_file_id id; + bfs_stat_id(statbuf, &id); struct trie_leaf *leaf = trie_insert_mem(seen, id, sizeof(id)); if (!leaf) { -- cgit v1.2.3