{"thread":{"id":"17475","subject":"[PATCH JGIT] Little performance optimization - replace the previous one","startedAt":"2009-01-31T14:19:26Z","lastAt":"2009-01-31T14:19:26Z","messageCount":1,"participants":["Yann Simon"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"102696","messageId":"1233411566.7844.11.camel@localhost","threadId":"17475","inReplyTo":null,"subject":"[PATCH JGIT] Little performance optimization - replace the previous one","fromName":"Yann Simon","fromEmail":"yann.simon.fr@gmail.com","sentAt":"2009-01-31T14:19:26Z","receivedAt":"2009-01-31T14:19:26Z","isPatch":true,"sender":{"key":"yann.simon.fr@gmail.com","avatar":"https://gravatar.com/avatar/2d926895d27ac988c5c8e591887e5a6a4c7036390403c74fce92519119b887a0?d=mp&s=160"},"body":"- avoid one if\n- avoid to calculate 2 times the same value\n\nSigned-off-by: Yann Simon <yann.simon.fr@gmail.com>\n---\n .../src/org/spearce/jgit/lib/GitIndex.java         |    6 ++----\n 1 files changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java\nb/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java\nindex 454b540..6eeccff 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/GitIndex.java\n@@ -411,11 +411,9 @@ Entry(ByteBuffer b) {\n                 * @throws IOException\n                 */\n                public boolean update(File f) throws IOException {\n-                       boolean modified = false;\n                        long lm = f.lastModified() * 1000000L;\n-                       if (mtime != lm)\n-                               modified = true;\n-                       mtime = f.lastModified() * 1000000L;\n+                       boolean modified = mtime != lm;\n+                       mtime = lm;\n                        if (size != f.length())\n                                modified = true;\n                        if (config_filemode()) {\n--\n1.6.0.6\n"}]}