def _shortcut_path_args(up_iof, up_hofs, down_iof, down_hofs):
    """
    Helper function to build args list passed to path constructor
    """
    args = []
    for iof, hofs in [(up_iof, up_hofs), (down_iof, down_hofs)]:
        l = len(hofs)
        # Any shortcut path with 2 HOFs is redundant, and can be dropped.
        if l > 2:
            iof.hops = l
            args.extend([iof, hofs])
    return args