Tim Peters wrote:
[Florent Guillaume]
Frankly I don't see the point of using bisect if you do a linear pass on
the list first. The original code was clearer and was faster.
If you had a "natural" way of getting the index, then why not. But anyway
this kind of hook list will have only a few elements in it. Optimize
later.
Optimization isn't the point: it's the purpose of bisect.insort() to
maintain a sorted list, and trusting a standard library function to do its
documented job is better for long-term reliability and readability than
trying to roll our own inline.
I agree the `index` computation here is overly complicated (in fact, I
believe it's incorrect), but it doesn't need to be. I'll repair that.
I guess you could simply store and increment then index as an attribute of
the transaction, yes.
Florent
--
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com [EMAIL PROTECTED]
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/
ZODB-Dev mailing list - ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev