summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-03-06 22:25:56 -0800
committerTavian Barnes <tavianator@tavianator.com>2019-03-06 22:25:56 -0800
commitb1d0e0e97ce747534a945a6fe0c3a15ccd8dbf00 (patch)
tree57b2f054611114783e7499996e730611691f94ff /eval.c
parentd4a4ef26ef5245813ed74847147ce7f58c5a5232 (diff)
downloadbfs-b1d0e0e97ce747534a945a6fe0c3a15ccd8dbf00.tar.xz
parse: Use a trie to hold currently open files
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c6
1 files changed, 2 insertions, 4 deletions
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) {