ソースを参照

Use FileSnapshot to get lastModified on PackFile

Do not redundantly call File.lastModified() for extracting the
timestamp of the PackFile but rather use consistently the FileSnapshot
which reads all file attributes in a single bulk call.

Change-Id: I932675ae4fe56dcd3833dac249816f097303bb09
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v4.5.6.201903121547-r
Luca Milanesio 5年前
コミット
2d116cd0ab
1個のファイルの変更1行の追加1行の削除
  1. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java ファイルの表示

@@ -164,8 +164,8 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> {
*/
public PackFile(final File packFile, int extensions) {
this.packFile = packFile;
this.packLastModified = (int) (packFile.lastModified() >> 10);
this.fileSnapshot = FileSnapshot.save(packFile);
this.packLastModified = (int) (fileSnapshot.lastModified() >> 10);
this.extensions = extensions;

// Multiply by 31 here so we can more directly combine with another

読み込み中…
キャンセル
保存