From d93e5d5da230876e946aa94f59e706d3b798c62b Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 11 Oct 2009 20:17:24 -0400 Subject: Reduce the amount of data translation by having the tracers record data in a form more like it will be consumed. Also should reduce the amount of work the tracers have to do. --- coverage/data.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'coverage/data.py') diff --git a/coverage/data.py b/coverage/data.py index 28925f54..fd6256e1 100644 --- a/coverage/data.py +++ b/coverage/data.py @@ -147,14 +147,14 @@ class CoverageData: for filename, file_data in new_lines.items(): self.lines.setdefault(filename, {}).update(file_data) - def add_line_data(self, data_points): + def add_line_data(self, line_data): """Add executed line data. - `data_points` is (filename, lineno) pairs. + `line_data` is { filename: { lineno: True, ... }, ...} """ - for filename, lineno in data_points: - self.lines.setdefault(filename, {})[lineno] = True + for filename, linenos in line_data.items(): + self.lines.setdefault(filename, {}).update(linenos) def add_arc_data(self, arc_data): for filename, arc in arc_data: -- cgit v1.2.1