From aa9af88224fac4d25d5bf1d2f4757b8ffd2c22ee Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 18 Jul 2015 14:09:54 -0400 Subject: 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. --- coverage/control.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'coverage/control.py') 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. -- cgit v1.2.1