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() {
|
private void readChangesForReplace() {
|
||||||
try (TraceTimer traceTimer = newTimer("readChangesForReplace")) {
|
try (TraceTimer traceTimer = newTimer("readChangesForReplace")) {
|
||||||
Collection<ChangeNotes> allNotes =
|
replaceByChange.values().stream()
|
||||||
notesFactory.createUsingIndexLookup(
|
.map(r -> r.ontoChange)
|
||||||
replaceByChange.values().stream().map(r -> r.ontoChange).collect(toList()));
|
.map(id -> notesFactory.create(project.getNameKey(), id))
|
||||||
for (ChangeNotes notes : allNotes) {
|
.forEach(notes -> replaceByChange.get(notes.getChangeId()).notes = notes);
|
||||||
replaceByChange.get(notes.getChangeId()).notes = notes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user