Ensure recorder loaded first to capture all

This commit is contained in:
Paulus Schoutsen committed 2015-01-31 20:05:18 -08:00
1 parent 10bbc3d6e1
commit 3c95d80d3e
2 files changed
+16 -1

No files matched your search

+10 -1
View File
@@ -216,12 +216,21 @@ class OrderedSet(collections.MutableSet):
return key in self.map
def add(self, key):
""" Add an element to the set. """
""" Add an element to the end of the set. """
if key not in self.map:
end = self.end
curr = end[1]
curr[2] = end[1] = self.map[key] = [key, curr, end]
def promote(self, key):
""" Promote element to beginning of the set, add if not there. """
if key in self.map:
self.discard(key)
begin = self.end[2]
curr = begin[1]
curr[2] = begin[1] = self.map[key] = [key, curr, begin]
def discard(self, key):
""" Discard an element from the set. """
if key in self.map: