Skip to content

Commit

Permalink
slight performance improvement in dfs phase
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed Feb 15, 2010
1 parent e768f67 commit 687d795
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@ public AggregatedDfs aggregateDfs(Iterable<DfsSearchResult> results) {
int numDocs = 0;
for (DfsSearchResult result : results) {
for (int i = 0; i < result.freqs().length; i++) {
int freq = dfMap.get(result.terms()[i]);
if (freq == -1) {
freq = result.freqs()[i];
} else {
freq += result.freqs()[i];
}
dfMap.put(result.terms()[i], freq);
dfMap.adjustOrPutValue(result.terms()[i], result.freqs()[i], result.freqs()[i]);
}
numDocs += result.numDocs();
}
Expand Down

0 comments on commit 687d795

Please sign in to comment.