Changeset 328f544


Ignore:
Timestamp:
Dec 16, 2016 5:50:26 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
4615fce
Parents:
0c76201
Message:

minor optimization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java

    r0c76201 r328f544  
    817817    private static void addEntry(Map<String, List<String>> headers, String key, String value) {
    818818        List<String> entry = headers.get(key);
    819         if(entry == null) {
    820                 headers.put(key, entry = new ArrayList<String>());
     819        if (entry == null) {
     820            headers.put(key, entry = new ArrayList<String>(1));
    821821        }
    822822        entry.add(value);       
     
    828828    private static void setEntry(Map<String, List<String>> headers, String key, String value) {
    829829        List<String> entry = headers.get(key);
    830         if(entry == null) {
    831                 headers.put(key, entry = new ArrayList<String>());
     830        if (entry == null) {
     831            headers.put(key, entry = new ArrayList<String>(1));
     832        } else {
     833            entry.clear();
    832834        }
    833         entry.clear();
    834835        entry.add(value);
    835836    }
Note: See TracChangeset for help on using the changeset viewer.