PatchSetApproval: Replace copy constructors with instance methods
In a few cases, change the semantics to avoid the premature optimization of returning the same instance if the patch set already matches. In the near future in this series, PatchSetApproval will become deeply immutable, so there will be no functional difference between different instances. Change-Id: Iba9e3d6f5fbd7a99ef015144b6550b67a73400be
This commit is contained in:
@@ -341,7 +341,7 @@ public class ChangeNotes extends AbstractChangeNotes<ChangeNotes> {
|
||||
ImmutableListMultimap.Builder<PatchSet.Id, PatchSetApproval> b =
|
||||
ImmutableListMultimap.builder();
|
||||
for (Map.Entry<PatchSet.Id, PatchSetApproval> e : state.approvals()) {
|
||||
b.put(e.getKey(), new PatchSetApproval(e.getValue()));
|
||||
b.put(e.getKey(), e.getValue().copy());
|
||||
}
|
||||
approvals = b.build();
|
||||
}
|
||||
|
Reference in New Issue
Block a user