def next_marker_by_offset(collection, limit, marker):
    """
    Returns the next marker that is just the current marker offset by the
    length of the collection or the limit, whichever is smaller

    :param collection: an iterable containing the collection to be paginated
    :param limit: the limit on the collection
    :marker: the current marker used to obtain this collection

    :return: the next marker that would be used to fetch the next collection,
        based on the offset from the current marker
    """
    return (marker or 0) + limit