code: void cleanChain()
    {
  
      if (tc.isEntryEnabled())
        tc.entry(this,cclass, "cleanChain");
  
      for (PartialMatch p = this; p.next != null; )
        if (p.next.isEmpty())
          p.next = p.next.next;
        else
          p = p.next;
  
      if (tc.isEntryEnabled())
        tc.exit(this,cclass, "cleanChain");
    }
docs: Remove empty entries from a chain (except for the anchor, which is never removed)