Skip to content

Commit 6ef1059

Browse files
Vladimir Kotalahornace
Vladimir Kotal
authored andcommitted
do not create Statistics object unnecessarily
1 parent 5752d8b commit 6ef1059

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ private void doFileHistory(String filename, List<HistoryEntry> historyEntries,
103103
Repository repository, File srcFile, File root, boolean renamed)
104104
throws HistoryException {
105105

106-
Statistics statRepoHist = new Statistics();
107-
108106
File file = new File(root, filename);
109107
// Only store directory history for the top-level directory.
110108
if (file.isDirectory() && !filename.equals(repository.getDirectoryName())) {
111109
LOGGER.log(Level.FINE, "Not storing history cache for {0}: not top level directory", file);
112110
return;
113111
}
114112

113+
Statistics statRepoHist = new Statistics();
114+
115115
/*
116116
* If the file was renamed (in the changesets that are being indexed),
117117
* its history is not stored in the historyEntries so it needs to be acquired

0 commit comments

Comments
 (0)