Get rid of empty if-statements

Change-Id: Ie1a6a8e60bcb7affd4c8fe7432d6bb93ca499637
This commit is contained in:
David Pursehouse
2015-03-16 17:43:54 +09:00
parent d70fc02a99
commit 9319d0de88
5 changed files with 8 additions and 10 deletions

View File

@@ -196,8 +196,7 @@ public class Daemon extends SiteProgram {
}
manager.add(GarbageCollectionLogFile.start(getSitePath()));
if (consoleLog) {
} else {
if (!consoleLog) {
manager.add(ErrorLogFile.start(getSitePath()));
}

View File

@@ -68,10 +68,9 @@ public class Section {
flags.cfg.setStringList(section, subsection, name, all);
}
} else if (all.size() == 0) {
} else if (all.size() == 1) {
flags.cfg.unset(section, subsection, name);
} else {
} else if (all.size() != 0) {
all.remove(0);
flags.cfg.setStringList(section, subsection, name, all);
}

View File

@@ -154,9 +154,10 @@ public class ReceiveCommitsAdvertiseRefsHook implements AdvertiseRefsHook {
RevCommit c;
try {
while ((c = rw.next()) != null && toInclude.size() < max) {
if (alreadySending.contains(c)) {
} else if (toInclude.contains(c)) {
} else if (c.getParentCount() > 1) {
if (alreadySending.contains(c)
|| toInclude.contains(c)
|| c.getParentCount() > 1) {
// Do nothing
} else if (toInclude.size() < base) {
toInclude.add(c);
} else {

View File

@@ -177,7 +177,7 @@ class PatchScriptBuilder {
boolean hugeFile = false;
if (a.mode == FileMode.GITLINK || b.mode == FileMode.GITLINK) {
// Do nothing
} else if (a.src == b.src && a.size() <= context
&& content.getEdits().isEmpty()) {
// Odd special case; the files are identical (100% rename or copy)

View File

@@ -338,8 +338,7 @@ public abstract class BaseCommand implements Command {
return 127;
}
if (e instanceof UnloggedFailure) {
} else {
if (!(e instanceof UnloggedFailure)) {
final StringBuilder m = new StringBuilder();
m.append("Internal server error");
if (userProvider.get().isIdentifiedUser()) {