Don't obtain 0 approvals or submit approvals in dashboards
A 0 vote for a category is pointless. It won't display as a value in the client UI and is often created by the server when a user is CC'd onto a change, or added as a reviewer. There is no value in sending it to the client when we get the approvals for the dashboard. The submit approval is used as a log to say who submitted the change, but is also not displayed in the UI, so we can skip over it and not transmit. Removing both of these items reduces the transfer size of the response we need to send to decorate the approval columns in a user's dashboard. Change-Id: I28f1dded506285ce2071287db403ed5ac34ac61b Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -349,6 +349,10 @@ class PatchDetailServiceImpl extends BaseServiceImplementation implements
|
||||
if (change.getStatus().isOpen()) {
|
||||
fs.normalize(approvalTypes.getApprovalType(category), ca);
|
||||
}
|
||||
if (ca.getValue() == 0
|
||||
|| ApprovalCategory.SUBMIT.equals(category)) {
|
||||
continue;
|
||||
}
|
||||
psas.put(category, ca);
|
||||
}
|
||||
|
||||
@@ -390,6 +394,10 @@ class PatchDetailServiceImpl extends BaseServiceImplementation implements
|
||||
if (change.getStatus().isOpen()) {
|
||||
fs.normalize(approvalTypes.getApprovalType(category), ca);
|
||||
}
|
||||
if (ca.getValue() == 0
|
||||
|| ApprovalCategory.SUBMIT.equals(category)) {
|
||||
continue;
|
||||
}
|
||||
boolean keep = true;
|
||||
if (psas.containsKey(category)) {
|
||||
final short oldValue = psas.get(category).getValue();
|
||||
|
||||
Reference in New Issue
Block a user