title: Confusion about HashMap#treeifyBin
body: <p>I'm reading source code about <code>HashMap#treeifyBin</code> function. </p>
  
  <p>It's confused why does it check </p>
  
  <pre><code>if ((tab[index] = hd) != null)
  </code></pre>
  
  <p>since it already checked it before</p>
  
  <pre><code>(e = tab[index = (n - 1) &amp; hash]) != null
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>final void treeifyBin(Node&lt;K,V&gt;[] tab, int hash) {
      int n, index; Node&lt;K,V&gt; e;
      if (tab == null || (n = tab.length) &lt; MIN_TREEIFY_CAPACITY)
          resize();
      else if ((e = tab[index = (n - 1) &amp; hash]) != null) {
          TreeNode&lt;K,V&gt; hd = null, tl = null;
          do {
              TreeNode&lt;K,V&gt; p = replacementTreeNode(e, null);
              if (tl == null)
                  hd = p;
              else {
                  p.prev = tl;
                  tl.next = p;
              }
              tl = p;
          } while ((e = e.next) != null);
          if ((tab[index] = hd) != null)  // why do we need this line?
              hd.treeify(tab);
      }
  }
  </code></pre>