ReceiveCommits: Avoid use of secondary index in readChangesForReplace
This is a follow-up of Ifc83162780. Avoid using secondary index also in readChangesForReplace() because the project attribute is always available. Change-Id: I9d0cc632d24a631c128715b79f7a620da99f61eb
This commit is contained in:
@@ -2691,12 +2691,10 @@ class ReceiveCommits {
|
||||
|
||||
private void readChangesForReplace() {
|
||||
try (TraceTimer traceTimer = newTimer("readChangesForReplace")) {
|
||||
Collection<ChangeNotes> allNotes =
|
||||
notesFactory.createUsingIndexLookup(
|
||||
replaceByChange.values().stream().map(r -> r.ontoChange).collect(toList()));
|
||||
for (ChangeNotes notes : allNotes) {
|
||||
replaceByChange.get(notes.getChangeId()).notes = notes;
|
||||
}
|
||||
replaceByChange.values().stream()
|
||||
.map(r -> r.ontoChange)
|
||||
.map(id -> notesFactory.create(project.getNameKey(), id))
|
||||
.forEach(notes -> replaceByChange.get(notes.getChangeId()).notes = notes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user