Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaffer committed May 17, 2016
1 parent 0630964 commit de26ae3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/fsevents-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ try { fsevents = require('fsevents'); } catch (error) {}
// (may be shared across chokidar FSWatcher instances)
var FSEventsWatchers = Object.create(null);

// Threshold of duplicate path prefixes at which to start
// consolidating going forward
var consolidateThreshhold = 10;

// Private function: Instantiates the fsevents interface

// * path - string, path to be watched
Expand Down Expand Up @@ -98,26 +102,23 @@ function setFSEventsListener(path, realPath, listener, rawEmitter) {
};
}

var consolidateThreshhold = 10;

// Decide whether or not we should start a new higher-level
// parent watcher
function couldConsolidate(path) {
var candidates = {};
var keys = Object.keys(FSEventsWatchers)
var count = 0
var keys = Object.keys(FSEventsWatchers);
var count = 0;

for (var i = 0, len = keys.length; i < len; ++i) {
var watchPath = keys[i]
var watchPath = keys[i];
if (watchPath.indexOf(path) === 0) {
count++
count++;
if (count >= consolidateThreshhold) {
return true
return true;
}
}
}

return false
return false;
}

// Find the parent of a given path
Expand Down

0 comments on commit de26ae3

Please sign in to comment.