def _locate_files_to_delete(algorithm, rotated_files, next_rotation_id):
    """Looks for hanoi_rotator generated files that occupy the same slot
    that will be given to rotation_id.
    """
    rotation_slot = algorithm.id_to_slot(next_rotation_id)
    for a_path, a_rotation_id in rotated_files:
        if rotation_slot == algorithm.id_to_slot(a_rotation_id):
            yield a_path
