Simplify some code, mainly removing elses
This commit is contained in:
parent
9a0ba186e6
commit
62f6fd3d44
@ -268,12 +268,11 @@ public class RepoPersister {
|
||||
}
|
||||
}
|
||||
|
||||
if (toDelete.size() > 0) {
|
||||
Uri uri = TempApkProvider.getApksUri(repo, toDelete);
|
||||
return ContentProviderOperation.newDelete(uri).build();
|
||||
} else {
|
||||
if (toDelete.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
Uri uri = TempApkProvider.getApksUri(repo, toDelete);
|
||||
return ContentProviderOperation.newDelete(uri).build();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -53,9 +53,11 @@ public class DownloaderFactory {
|
||||
if (isBluetoothAddress(url)) {
|
||||
String macAddress = url.getHost().replace("-", ":");
|
||||
return new BluetoothDownloader(context, macAddress, url, destFile);
|
||||
} else if (isOnionAddress(url)) {
|
||||
}
|
||||
if (isOnionAddress(url)) {
|
||||
return new TorHttpDownloader(context, url, destFile);
|
||||
} else if (isLocalFile(url)) {
|
||||
}
|
||||
if (isLocalFile(url)) {
|
||||
return new LocalFileDownloader(context, url, destFile);
|
||||
}
|
||||
return new HttpDownloader(context, url, destFile, username, password);
|
||||
|
@ -328,14 +328,12 @@ public class BluetoothServer extends Thread {
|
||||
|
||||
// Announce that the file server accepts partial content requests
|
||||
private Response createResponse(NanoHTTPD.Response.Status status, String mimeType, String content) {
|
||||
Response res = new Response(status.getRequestStatus(), mimeType, content);
|
||||
return res;
|
||||
return new Response(status.getRequestStatus(), mimeType, content);
|
||||
}
|
||||
|
||||
// Announce that the file server accepts partial content requests
|
||||
private Response createResponse(NanoHTTPD.Response.Status status, String mimeType, InputStream content) {
|
||||
Response res = new Response(status.getRequestStatus(), mimeType, content);
|
||||
return res;
|
||||
return new Response(status.getRequestStatus(), mimeType, content);
|
||||
}
|
||||
|
||||
public static String getMimeTypeForFile(String uri) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user