~bzr-pqm/bzr/bzr.dev

Viewing all changes in revision 4679.3.58.

  • Committer: John Arbash Meinel
  • Date: 2009-10-02 05:41:24 UTC
  • mto: (4679.6.1 2.1-export-c-api)
  • mto: This revision was merged to the branch mainline in revision 4735.
  • Revision ID: john@arbash-meinel.com-20091002054124-pbt81bw3utkr5ufu
Adding a StaticTupleInterner class.

Functions basically like a dict, but with less memory overhead.
(well, possibly more like a set that also implements __getitem__).
For now, it allows arbitrary objects, though I'm considering
only allowing StaticTuple objects for some ease-of-implementation.
Especially if I find I want to cache the hash() on StaticTuple for
performance, then I may want to expose that in StaticTupleInterner.


For now, this only compiles via Cython, but only because I'm using
'inline' in one place.
It wouldn't be too hard to factor that out, or make it conditional
with an IF and DEF bits.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: