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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user