Iterable<PatchSetApproval> approvals;
if (cd != null) {
approvals = cd.currentApprovals(Providers.of(db));
} else {
approvals = db.patchSetApprovals().byPatchSet(patchSet.getId());
}
for (PatchSetApproval a : approvals) {
if (a.getValue() == 0) {
continue;