<headius[m]>
the block version was cute but I realized it was only using blocks because of those two state variable and the non-local return
<headius[m]>
so I just left the return sled "ret" check in there
<headius[m]>
this should have no block overhead other than the original conditional, and now only two ivars
<enebo[m]>
headius: looks reasonable to me
<enebo[m]>
Will it compile if you had manually inlined all check where they are called? It would be heinous but it could even kill needing an instance and the two vars right?
<headius[m]>
hmm, maybe
<headius[m]>
I think intellij can automatically do it so I can give it a try
<enebo[m]>
If you try it then I would add a nice "begin/end" set of comments
<enebo[m]>
but not allocing the instance and no ivars you would think would help
<headius[m]>
yeah, wouldn't need the BSearch object either then
<enebo[m]>
feels like some old school rbx code for eliminating expensive constructs but whatevs
<enebo[m]>
"if the code fits you must commit" -Gittie Cochran
<headius[m]>
there's probably a better way to write this algorithm that isn't so C like but I think this is fine
<headius[m]>
ok one more rev... it was simple enough to pull out the conditional bodies into their own methods, so it should compile better now
subbu|lunch is now known as subbu
<headius[m]>
fzakaria: so bsearch on infinite range... it works by starting with an increment of 1 and then doubling that at each iteration until the condition indicates we've passed the value in question
<headius[m]>
so it basically tries exponentially higher (or lower) values until the desired search value is bracketed, and then does a normal binary search on that range