Trim the Dispatcher.patch()

Make Dispatcher.patch() concise and easy to read.
Please refer the logic from ce8620d7.

Change-Id: Ibf5d8c4d24f09f23e666e0e308c0462c9147edab
This commit is contained in:
Bruce Zu
2013-11-27 22:12:00 +08:00
parent 415f8e8405
commit 045808f28b

View File

@@ -601,16 +601,7 @@ public class Dispatcher {
panel = 0 <= c ? token.substring(c + 1) : ""; panel = 0 <= c ? token.substring(c + 1) : "";
} }
if ("sidebyside".equals(panel)) { if ("unified".equals(panel)) {
return new PatchScreen.SideBySide( //
id, //
patchIndex, //
patchSetDetail, //
patchTable, //
top, //
baseId //
);
} else if ("unified".equals(panel)) {
return new PatchScreen.Unified( // return new PatchScreen.Unified( //
id, // id, //
patchIndex, // patchIndex, //
@@ -634,14 +625,14 @@ public class Dispatcher {
); );
} }
return new SideBySide2(baseId, id.getParentKey(), id.get()); return new SideBySide2(baseId, id.getParentKey(), id.get());
} else if ("".equals(panel)) { } else if ("".equals(panel) || "sidebyside".equals(panel)) {
return new PatchScreen.SideBySide( return new PatchScreen.SideBySide(//
id, id, //
patchIndex, patchIndex,//
patchSetDetail, patchSetDetail,//
patchTable, patchTable,//
top, top,//
baseId); baseId);//
} }
} }