Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add top (?) that takes max #9

Open
dblock opened this Issue · 0 comments

1 participant

@dblock

Not sure if this is a good name for it. We do a lot of fetching an array from the top of the heap (priority queue).

def top(max)
  results = []
  while results.size < max and size > 0 do 
    results << pop 
  end
  results
end

If you think it's a good idea, I'll make a proper pull request with a UT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.