forked from I2P_Developers/i2p.i2p
minor optimization
This commit is contained in:
@@ -816,8 +816,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
|||||||
*/
|
*/
|
||||||
private static void addEntry(Map<String, List<String>> headers, String key, String value) {
|
private static void addEntry(Map<String, List<String>> headers, String key, String value) {
|
||||||
List<String> entry = headers.get(key);
|
List<String> entry = headers.get(key);
|
||||||
if(entry == null) {
|
if (entry == null) {
|
||||||
headers.put(key, entry = new ArrayList<String>());
|
headers.put(key, entry = new ArrayList<String>(1));
|
||||||
}
|
}
|
||||||
entry.add(value);
|
entry.add(value);
|
||||||
}
|
}
|
||||||
@@ -827,10 +827,11 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
|
|||||||
*/
|
*/
|
||||||
private static void setEntry(Map<String, List<String>> headers, String key, String value) {
|
private static void setEntry(Map<String, List<String>> headers, String key, String value) {
|
||||||
List<String> entry = headers.get(key);
|
List<String> entry = headers.get(key);
|
||||||
if(entry == null) {
|
if (entry == null) {
|
||||||
headers.put(key, entry = new ArrayList<String>());
|
headers.put(key, entry = new ArrayList<String>(1));
|
||||||
|
} else {
|
||||||
|
entry.clear();
|
||||||
}
|
}
|
||||||
entry.clear();
|
|
||||||
entry.add(value);
|
entry.add(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user