diff options
Diffstat (limited to 'Mailman/Archiver/HyperDatabase.py')
| -rw-r--r-- | Mailman/Archiver/HyperDatabase.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Mailman/Archiver/HyperDatabase.py b/Mailman/Archiver/HyperDatabase.py index 488c4677e..7a7a838c0 100644 --- a/Mailman/Archiver/HyperDatabase.py +++ b/Mailman/Archiver/HyperDatabase.py @@ -88,8 +88,10 @@ class DumbBTree: else: self.current_index = self.current_index + 1 - - + def clear(self): + # bulk clearing much faster than deleting each item, esp. with the + # implementation of __delitem__() above :( + self.dict = {} def first(self): if not self.sorted: @@ -296,7 +298,10 @@ class HyperDatabase(pipermail.Database): def newArchive(self, archive): pass def clearIndex(self, archive, index): self.__openIndices(archive) - index=getattr(self, index+'Index') +## index=getattr(self, index+'Index') + if hasattr(self.threadIndex, 'clear'): + self.threadIndex.clear() + return finished=0 try: key, msgid=self.threadIndex.first() |
