Little performance optimization - replace the previous one
PATCH 1/1 Little performance optimization - replace the previous one
- avoid one if
- avoid to calculate 2 times the same value
Signed-off-by Yann Simon <[email protected]>
--- .../src/org/spearce/jgit/lib/GitIndex.java | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
(quoted diff) +0 -0
b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java index 454b540..6eeccff 100644
org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java +2 -4
@@ -411,11 +411,9 @@ Entry(ByteBuffer b) { * @throws IOException */ public boolean update(File f) throws IOException { - boolean modified = false; long lm = f.lastModified() * 1000000L; - if (mtime != lm) - modified = true; - mtime = f.lastModified() * 1000000L; + boolean modified = mtime != lm; + mtime = lm; if (size != f.length()) modified = true; if (config_filemode()) {
--
1.6.0.6