@justinmk haha, didn't expect to see that popping up! I was having great trouble getting that macro'd bsearch to work, and pasted that to show some C programming channel on IRC what kind of wrestling with the preprocessor I was trying to do. Of course, as can be expected from C channels on IRC, they deigned the question (and the asker) of insufficient difficulty/skill to merit their attention and instead started sniping me for being a n00b.

By the way, the article upon which I was basing that macro is here: http://www.pvk.ca/Blog/2012/07/03/binary-search-star-eliminates-star-branch-mispredictions/

Let's just say that the thought of the compiler generating those CMOV's and unrolling the loop for me in the toy 3D engine that gist refers too, was a very nice one. I'd like some help on getting a generic version of that to work for us! (the version you linked is most likely not functional at all, I don't remember getting it to work before just creating the non-generic version and moving on to more [threedee-simd](https://github.com/rikusalminen/threedee-simd) stuff).

> bsearch appears to be standard even in C89, so Vim must have a reason to avoid it.

It's also possible that this wasn't purely efficiency related (depends on how many times it gets called, we need a frequency analysis profiler or something I guess), but that some strange platform/compiler on which vim is supposed to run doesn't provide `bsearch`.