Remove redundant call to 'String.format()'

This commit is contained in:
Martin Fietz 2018-01-14 18:00:57 +01:00
parent 55e2ac4ebe
commit e44a54c965
1 changed files with 2 additions and 2 deletions

View File

@ -688,7 +688,7 @@ public abstract class NanoHTTPD {
outputStream.write(buff, 0, read);
outputStream.write(CRLF);
}
outputStream.write(String.format("0\r\n\r\n").getBytes());
outputStream.write("0\r\n\r\n".getBytes());
}
private void sendAsFixedLength(OutputStream outputStream, int pending) throws IOException {
@ -858,7 +858,7 @@ public abstract class NanoHTTPD {
this.tempFileManager = tempFileManager;
this.inputStream = new PushbackInputStream(inputStream, BUFSIZE);
this.outputStream = outputStream;
String remoteIp = inetAddress.isLoopbackAddress() || inetAddress.isAnyLocalAddress() ? "127.0.0.1" : inetAddress.getHostAddress();
String remoteIp = inetAddress.isLoopbackAddress() || inetAddress.isAnyLocalAddress() ? "127.0.0.1" : inetAddress.getHostAddress().toString();
headers = new ArrayMap<>();
headers.put("remote-addr", remoteIp);