> But that's the point: the "old Judy" is heavily tested and in use in > a several applications. The "new code" is untested, so there's a big > issue trusting it. > > However the new code is more readable, more modern, less macro heavy, > and easier to build.
Right, in which case there's less reason to worry about using it. > And Judy's string stuff only works on NTBS, not strings with counted > length. Sure, a long-known, discussed, and documented shortcoming. > You can get counted lengths by roll your own Judy arrays of arrays: > just round the string up to multiple of 8 bytes, use J1 to store the > length and J2 for the first 8 bytes. If length > 8 then store a > second array in the first. [I'm thing of a set of strings here]. Yes, the only catch is that the strings are sorted by length, which is fine if you don't care. > Ok, so all this is easy, but how do yo remove a string from the set? > You can't just remove the key, because that would leave the value > (another Judy array) dangling. You have to make sure that second Judy > array is empty first. Yes, you must traverse cleanly any array-of-array to do proper removals, nothing special about length-associated (rather than JudySL*() length-terminated) string arrays. > Yeah, it's just a bottom up recursive descent, but then this is a > trivial example. If you have a harder example where you're mapping > stuff, you have to be careful the target is deleted. For example > consider mapping to a C++ shared pointer, you have to invoke the > destructor. Absolutely. In fact I wrote a lot of code just like that in the last few years. Care is required, but then it works well. TANSTAAFL, if you don't mind possibly serious performance losses, you can always use languages or tools that manage the memory for you. > Easy to mess all those indirections up .. :) Agreed. Alan ------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ Judy-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/judy-devel
