summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-18 14:09:54 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-18 14:09:54 -0400
commitaa9af88224fac4d25d5bf1d2f4757b8ffd2c22ee (patch)
tree3697e6162d46fdb6e17b2c6d694314dff19280ec /coverage/control.py
parented2266434af1582cd94c1b89f7172bad62f88745 (diff)
downloadpython-coveragepy-git-aa9af88224fac4d25d5bf1d2f4757b8ffd2c22ee.tar.gz
Refactor collector->data; data has only one of lines and arcs.
Now the collector communicates directly with the data, and control is less involved. In the data, when measuring arcs, only arcs are stored. Lines are calculated as needed. This saves space in the data file, and is faster.
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 7c14e1b0..3f6f5aca 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -744,15 +744,7 @@ class Coverage(object):
if not self._measured:
return
- def abs_file_dict(d):
- """Return a dict like d, but with keys modified by `abs_file`."""
- return dict((abs_file(k), v) for k,v in iitems(d))
-
- # TODO: seems like this parallel structure is getting kinda old...
- self.data.add_lines(abs_file_dict(self.collector.get_line_data()))
- self.data.add_arcs(abs_file_dict(self.collector.get_arc_data()))
- self.data.add_plugins(abs_file_dict(self.collector.get_plugin_data()))
- self.collector.reset()
+ self.collector.save_data(self.data)
# If there are still entries in the source_pkgs list, then we never
# encountered those packages.