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) {
|
||||
List<String> entry = headers.get(key);
|
||||
if(entry == null) {
|
||||
headers.put(key, entry = new ArrayList<String>());
|
||||
if (entry == null) {
|
||||
headers.put(key, entry = new ArrayList<String>(1));
|
||||
}
|
||||
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) {
|
||||
List<String> entry = headers.get(key);
|
||||
if(entry == null) {
|
||||
headers.put(key, entry = new ArrayList<String>());
|
||||
}
|
||||
if (entry == null) {
|
||||
headers.put(key, entry = new ArrayList<String>(1));
|
||||
} else {
|
||||
entry.clear();
|
||||
}
|
||||
entry.add(value);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user