Robert Klemme wrote:
> On 12.08.2008 18:51, Myrddin Emrys wrote:
> Exactly with break. :-)

For some reason I thought break wouldn't work in this context... stupid 
me. I should have checked.

> I rather suggest to use binary search.  There is a library in RAA that
> does it.  Maybe there's also a gem.

I suspect so as well, but this particular application doesn't need it. 
Really, it doesn't need to break early either (the arrays in question 
are accessed frequently, but are under 100 items long), but for some 
reason that inefficiency was really bothering me, regardless of its 
actual impact. :-)
-- 
Posted via http://www.ruby-forum.com/.