]>
go.fuhry.dev Git - fsnotify.git/commit
inotify: simplify bookkeeping of watched paths (#543)
Create a new watches type to keep track of the watches instead of
keeping two maps on the Watcher and accessing these directly.
This makes the bookkeeping a bit easier to follow, and we no longer need
to worry about locking map access as the watcher type takes care of that
now.
Came up in #472 where I want to keep track if a path was added
recursively, and this makes that a bit easier.
Also seems a bit faster:
BenchmarkWatch-2 903709 7122 ns/op 194 B/op 3 allocs/op
BenchmarkWatch-2 923980 6322 ns/op 196 B/op 3 allocs/op
Although that benchmark is very simply and only tests one code path;
just want to make sure it's not a horrible regression.