shama / gaze

:crystal_ball: A globbing fs.watch wrapper built from the best parts of other fine watch libs.
MIT License
1.16k stars 167 forks source link

Fixes #214 - Gaze.prototype._addToWatched repeating readDir of same d… #221

Closed chebum closed 8 years ago

chebum commented 8 years ago

Hi,

I dug into this problem to solve performance issue with watching large folders. @smithwib seems to be correct with a small change in the if statement. I added a test case to check readdirSync call count. With the fix number of directory listings reduced from 8 to 4 in the addToWatched test.

chebum commented 8 years ago

I've just noticed that my fix includes change from @wyicwx