<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Replace HTTPHeaderMap by HTTPHeaderList"
   href="https://bugs.webkit.org/show_bug.cgi?id=152828#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Replace HTTPHeaderMap by HTTPHeaderList"
   href="https://bugs.webkit.org/show_bug.cgi?id=152828">bug 152828</a>
              from <span class="vcard"><a class="email" href="mailto:youennf&#64;gmail.com" title="youenn fablet &lt;youennf&#64;gmail.com&gt;"> <span class="fn">youenn fablet</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=152828#c1">comment #1</a>)
<span class="quote">&gt; We also need to keep information about the first header with each name so
&gt; that set, get, contains, etc. don't have to search the whole list every time
&gt; they are called.</span >

Keeping the first index would optimize the case of get and contains.
set and remove would remain O(n), at least in a worst case scenario.
It would also slow down append().

I would first like to have a simple functional HTTPHeaderList with a clean API. Then it could be optimized internally to handle large sets.

For instance, keeping-first-index mechanism might be triggered when header set size is above a given threshold. Or it can be done lazily when a header is actually get.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>