> Use JudyLFirst for a nonexclusive search. Don't be fooled by the names :) > > First means >= key > Next means >key > Last means <= key > Prev means < key > Get means == key > > It's a bit weird, Dougs naming, but it is very consistent and > predictable what the functions do when you get the hang of it.
Right, except in this case it's not Doug's fault. :-) I was responsible for talking him into the first/next/last/prev model and the function naming. And I do think it works well. However, just like "simple" endianness issues always cause disproportionate problems in real life, so do boundary/limit and off-by-one issues, and start/next/end similarly. For instance now back at work I'm dealing with performance code where the last of N bits (N >= 127 typically) must be handled specially (sent with a special flag bit). Naturally the last bit is not handled in the main loop, but now there's redundant code, and even inline functions are considered to have too much overhead, and the guy I'm working for/with doesn't like macros because they "hide too much". Anyway I wish there was a standard nomenclature. One large package I inherited long ago had an incredible, and turgid, naming convention such that you could automatically name or decipher ANY object, with visual type checking. But the names themselves could be alphabet soup. In particular, if I recall right, Lim and End were inclusive versus exclusive end-of-range standards? Something like that, you get the idea. So a variable might be named iListLim. Well beyond that I'm not following the details of this thread, I'm glad Doug is participating -- carry on. Cheers, Alan ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ Judy-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/judy-devel
