diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-11 20:17:24 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-10-11 20:17:24 -0400 |
commit | e7f56282abb760b75217aac5c5a6e69c83dd0028 (patch) | |
tree | c20a779dd825ea758bdd3ad86036cebecf1d1365 /coverage/data.py | |
parent | 81699412dad10034be464469578170757e9d4afc (diff) | |
download | python-coveragepy-e7f56282abb760b75217aac5c5a6e69c83dd0028.tar.gz |
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.
Diffstat (limited to 'coverage/data.py')
-rw-r--r-- | coverage/data.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/coverage/data.py b/coverage/data.py index 28925f5..fd6256e 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: |