def RenumberDockRows(docks):
    """
    Takes a dock and assigns sequential numbers
    to existing rows.  Basically it takes out the gaps so if a
    dock has rows with numbers 0, 2, 5, they will become 0, 1, 2.

    :param `docks`: a list of :class:`AuiDockInfo` structures.
    """
    for ii in range(len(docks)):
        dock = docks[ii]
        dock.dock_row = ii
        for jj in range(len(dock.panes)):
            dock.panes[jj].dock_row = ii
        docks[ii] = dock
    return docks
