ocarina/libsaria/collection/table.py
Bryan Schumaker 71b3289f62 Improved collection indexing
I can now create an index over an entire collection faster.  The
bottleneck is still disk accesses, but I still think this was a good
challenge.
2010-08-12 08:27:21 -04:00

14 lines
208 B
Python

# Bryan Schumaker (8/8/2010)
class Table(dict):
def __init__(self):
dict.__init__(self)
self.next_id = 0
def insert(self, tags):
id = self.next_id
self[id] = tags
self.next_id += 1
return id