Clean up single char indexOf()

This commit is contained in:
zzz
2016-12-03 16:00:09 +00:00
parent f461d4881d
commit 42efed578a
16 changed files with 42 additions and 101 deletions

View File

@ -560,11 +560,7 @@ class NewsFetcher extends UpdateRunner {
try {
in.initialize(new FileInputStream(from));
out = new SecureFileOutputStream(to);
byte buf[] = new byte[4096];
int read;
while ((read = in.read(buf)) != -1) {
out.write(buf, 0, read);
}
DataHelper.copy(in, out);
} finally {
if (out != null) try {
out.close();

View File

@ -434,11 +434,7 @@ public class ConfigClientsHandler extends FormHandler {
tmp = new File(_context.getTempDir(), "plugin-" + _context.random().nextInt() + (isSU3 ? ".su3" : ".xpi2p"));
out = new BufferedOutputStream(new SecureFileOutputStream(tmp));
out.write(magic);
byte buf[] = new byte[16*1024];
int read = 0;
while ( (read = in.read(buf)) != -1) {
out.write(buf, 0, read);
}
DataHelper.copy(in, out);
out.close();
String url = tmp.toURI().toString();
// threaded... TODO inline to get better result to UI?