hamstergem / hamster

Efficient, Immutable, Thread-Safe Collection classes for Ruby
Other
1.89k stars 94 forks source link

Vector#bsearch should return an enumerator when no block given. #184

Closed xaviershay closed 9 years ago

xaviershay commented 9 years ago
irb(main):035:0> [1,2].bsearch
=> #<Enumerator: [1, 2]:bsearch>
irb(main):036:0> Hamster::Vector[1,2].bsearch
LocalJumpError: no block given (yield)
    from /Users/xavier/.gem/ruby/2.2.2/gems/hamster-1.0.0/lib/hamster/vector.rb:1048:in `bsearch'
    from (irb):36
    from /Users/xavier/.rubies/cruby-2.2.2/bin/irb:11:in `<main>'
alexdowad commented 9 years ago

2 nice catches (both this and #183). Do you intend to fix both of these, or would you like me to?

xaviershay commented 9 years ago

I'll fix them, just doing a full doc pass first.