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
commitf749a4bd0a01b452e3378cf85c8e760be9bb1ade (patch)
tree6bc6929b8a9ecf913767131a80f5207b3ac61e51 /coverage/control.py
parentefc976cfe783bff8af548e60c6146b489dde96e4 (diff)
downloadpython-coveragepy-f749a4bd0a01b452e3378cf85c8e760be9bb1ade.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 7c14e1b..3f6f5ac 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.