title: How "reserveCapacity" function works with "Dictionary" CollectionType in Swift?
body: <p>I was checking <code>reserveCapacity</code> function with <code>Array</code> &amp; <code>Dictionary</code> and observed this below  behaviour :-</p>
  <ol>
  <li><p>In <code>Array</code> I got it perfectly :</p>
  <pre><code>var array:Array&lt;String&gt; = Array&lt;String&gt;.init()
  
   array.reserveCapacity(2)
  
   print(array.capacity) // output : 2
  </code></pre>
  </li>
  <li><p>In <code>Dictionary</code> its giving below result due to <code>&quot;key:value&quot;</code> pairing  :</p>
  <pre><code>var dict:Dictionary&lt;String,Any&gt; = Dictionary&lt;String,Any&gt;.init()
  
    dict.reserveCapacity(2)
    print(dict.capacity) //output 3
  
    dict.reserveCapacity(0)
    print(dict.capacity) //output 0
    dict.reserveCapacity(1)
    print(dict.capacity) //output 1
  
    dict.reserveCapacity(2)
    print(dict.capacity) //output 3
  
    dict.reserveCapacity(3)
    print(dict.capacity) //output 3
    dict.reserveCapacity(4)
    print(dict.capacity) //output 6
    dict.reserveCapacity(5)
    print(dict.capacity) //output 6
    dict.reserveCapacity(6)
    print(dict.capacity) //output 6
    dict.reserveCapacity(7)
    print(dict.capacity) //output 12
    dict.reserveCapacity(8)
    print(dict.capacity) //output 12
    dict.reserveCapacity(9)
    print(dict.capacity) //output 12
    dict.reserveCapacity(10)
    print(dict.capacity) //output 12
    dict.reserveCapacity(11)
    print(dict.capacity) //output 12
    dict.reserveCapacity(12)
    print(dict.capacity) //output 12
    dict.reserveCapacity(13)
    print(dict.capacity) //output 24
    //.
    //.
    dict.reserveCapacity(24)
    print(dict.capacity) //output 24
    dict.reserveCapacity(25)
    print(dict.capacity) //output 48
    //.
    //.
    dict.reserveCapacity(48)
    print(dict.capacity) //output 48
    dict.reserveCapacity(49)
    print(dict.capacity) //output 96
    //.
    //.
    dict.reserveCapacity(96)
    print(dict.capacity) //output 96
  </code></pre>
  </li>
  </ol>
  <p>Can somebody will help me to understand  <code>reserveCapacity</code> function behaviour in case of  <code>Dictionary</code> that why and how its calculating <code>capacity</code> value ?</p>
  <p>Thank you so much in advance!!</p>