CommentDetail: Rewrite switch statement in include method with if + else

Change-Id: Ice480cab292327d1982afe2f81c167723e8e8363
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-02-06 14:59:14 +01:00
parent dde9fe9f64
commit d9071f45a7

View File

@@ -45,20 +45,16 @@ public class CommentDetail {
public void include(Change.Id changeId, Comment p) {
PatchSet.Id psId = new PatchSet.Id(changeId, p.key.patchSetId);
switch (p.side) {
case 0:
if (idA == null && idB.equals(psId)) {
a.add(p);
}
break;
case 1:
if (idA != null && idA.equals(psId)) {
a.add(p);
} else if (idB.equals(psId)) {
b.add(p);
}
break;
if (p.side == 0) {
if (idA == null && idB.equals(psId)) {
a.add(p);
}
} else if (p.side == 1) {
if (idA != null && idA.equals(psId)) {
a.add(p);
} else if (idB.equals(psId)) {
b.add(p);
}
}
}