Optimization: don't use FileUtil.pathsEqual() , paths returned by FileWatcher is already canonical.

This commit is contained in:
Sergey Evdokimov
2013-10-10 20:23:37 +04:00
parent 2723de7a57
commit cbff339ddb
@@ -377,13 +377,13 @@ public class FileWatcher {
if (fastPath && !changedPaths.isEmpty()) break;
for (String root : flatWatchRoots) {
if (FileUtil.pathsEqual(path, root)) {
if (FileUtil.namesEqual(path, root)) {
changedPaths.add(path);
continue ext;
}
if (isExact) {
String parentPath = new File(path).getParent();
if (parentPath != null && FileUtil.pathsEqual(parentPath, root)) {
if (parentPath != null && FileUtil.namesEqual(parentPath, root)) {
changedPaths.add(path);
continue ext;
}
@@ -397,7 +397,7 @@ public class FileWatcher {
}
if (!isExact) {
String parentPath = new File(root).getParent();
if (parentPath != null && FileUtil.pathsEqual(path, parentPath)) {
if (parentPath != null && FileUtil.namesEqual(path, parentPath)) {
changedPaths.add(root);
continue ext;
}