def _longkeysortreverse_direct(accessor, minv, maxv, limit):
    """minv or limit is None: do not optimize"""
    i = 0
    keys = sorted(accessor(min=minv, max=maxv), reverse=True)
    for key in keys:
        yield key
        i += 1
        if i == limit:
            return
    return
