Reviewers: Brian Wilkerson,
Description:
Use File.isFile() instead of exists() && !isDirectory().
This is slightly faster, 5300 ms vs. 7200 + 3500.
R=
brianwi...@google.com
BUG=
Please review this at
https://codereview.chromium.org/152123002/
SVN Base:
https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Affected files (+1, -1 lines):
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
Index:
editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
diff --git
a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
index
318a6e7ec4de97fda2dcbca2cbb85db027c77e71..4f3148ca6a4f4290271e7992c7d0bac075b38439
100644
---
a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
+++
b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/source/FileBasedSource.java
@@ -90,7 +90,7 @@ public class FileBasedSource implements Source {
@Override
public boolean exists() {
- return contentCache.getContents(this) != null || (file.exists()
&& !file.isDirectory());
+ return contentCache.getContents(this) != null || file.isFile();
}
@Override